Examples of ProtocolMessageTurnOver


Examples of nfc.sample.tictactoe.protocol.ProtocolMessageTurnOver

    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;
        }
View Full Code Here

Examples of nfc.sample.tictactoe.protocol.ProtocolMessageTurnOver

        game_state.setGameStateChangeListener(this);

    }

    private void initialiseGame() {
        turn_over = new ProtocolMessageTurnOver();
        game_state.initialiseGameState();

        // focus on central tile
        focused_tile_row = 1;
        focused_tile_col = 1;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.