// 7/1/10 M. Brenner import java.io.*; public class Packetmark extends APacket { static private final int DATASIZE = 3; private int col_, mark_, row_; public Packetmark (Channel channel) throws IOException { super (channel); row_ = getint (1); col_ = getint (1); mark_ = getint (1); } public Packetmark (int channelto, int row, int col, int mark) { super (channelto); row_ = row; col_ = col; mark_ = mark; } public void docommand() { Board.getinstance().mark (row_, col_, mark_); } public byte[] tobuffer() { initbuf (PACKETMARK, DATASIZE); intobuf (row_, 1); intobuf (col_, 1); intobuf (mark_, 1); return completebuf(); } public String toString() { int id; String text; text = "Packetmark\n"; text += " row : " + row_ + "\n"; text += " col : " + col_ + "\n"; text += " mark: " + mark_ + "\n"; text += "\n-----\n"; text += super.toString(); return text; } }