public void gameMessage(ProtocolMessage message) {
Utilities.log("XXXX gameMessage:" + message);
// should indicate it's now our turn
if(message instanceof ProtocolMessageTurnOver) {
// OK, it's our turn now!
ProtocolMessageTurnOver pmsg_to = (ProtocolMessageTurnOver) message;
Utilities.log("XXXX gameMessage: ProtocolMessageTurnOver");
game_state.setBoardLocked(false);
int other_symbol = pmsg_to.get_symbol_played();
// derive the symbol we're playing with from the one player 1 is using (they got to choose)
if(other_symbol == Constants.PLAYER_SYMBOL_CROSS) {
_symbol = Constants.PLAYER_SYMBOL_NOUGHT;
} else {
_symbol = Constants.PLAYER_SYMBOL_CROSS;
}
cmd_select_tile.set_symbol(_symbol);
int other_player_tile = pmsg_to.get_tile_changed();
game_state.updateTileOtherPlayer(other_player_tile, other_symbol);
setStatusMessage("It's your turn now!");
proto.stopListeningForMessages();
return;
}