BoardItemProto.java

jmud-0.11/src/BoardItemProto.java · 993 B

From the archive jmud-0_11.tgz

Download the archive   « Back to the archive contents

import java.io.BufferedReader;
import java.io.IOException;
import misc.Separators;
import util.log.Log;

import util.file.InvalidFileFormatException;
import util.log.Log;

class BoardItemProto extends ItemProto {

    int boardId;

  BoardItemProto(int zoneBase, int itemId, BufferedReader itemFile) 
    throws InvalidFileFormatException {

    super(zoneBase, itemId, itemFile);
    Log.log("Quadro: " + getName());

    try {
      boardId = Integer.parseInt(itemFile.readLine());
    }
    catch(IOException e) {
      throw new InvalidFileFormatException();
    }
    catch(NumberFormatException e) {
	throw new InvalidFileFormatException();
    }

  }

  protected void finalize() {
    super.finalize();
  }

  int getProtoType() {
    return Item.T_BOARD;
  }

  Item create() {
    return new BoardItem(this);
  }

    /////////////
    // Sheetable:

  public String getSheet() {
    return super.getSheet() + Separators.NL +
	"Quadro: " + boardId;
  }

    //
    /////////////

}

Site Stats

Snippets: 1791
Codebases: 571