BoardItem.java
jmud-0.11/src/BoardItem.java · 966 B
From the archive jmud-0_11.tgz
Download the archive « Back to the archive contents
import java.util.NoSuchElementException;
import java.io.BufferedWriter;
import java.io.IOException;
import misc.Separators;
import util.log.Log;
class BoardItem extends Item {
Board boardSystem = null;
BoardItem(BoardItemProto w) {
super(w);
try {
boardSystem = theWorld.findBoardById(w.boardId);
}
catch(NoSuchElementException e) {
Log.err("Sistema de quadros não encontrado: " + getId());
}
}
protected void finalize() {
super.finalize();
}
int getType() {
return T_BOARD;
}
Board getBoardSystem() {
return boardSystem;
}
/////////////
// Sheetable:
public String getSheet() {
return super.getSheet() + Separators.NL +
"Sistema: " + (boardSystem == null ? "Nenhum" : boardSystem.getSheet());
}
//
/////////////
void save(BufferedWriter writer) throws IOException {
super.save(writer);
writer.write(String.valueOf(prototype.getId())); writer.newLine();
}
}