@Override
    public ChannelBuffer serialize() {
        ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
        buffer.writeInt(id);
        buffer.writeInt(type.ordinal());
        for(int col = 0 ; col < board.maxCol; col++) {
            for(int row = 0 ; row < board.maxRow; row++) {
                buffer.writeInt(board.get(row, col).ordinal());
            }
        }
        return buffer;
    }