public GameTurn getMyTurn() { if (game.isPhaseSimultaneous()) { return game.getTurnForPlayer(localPlayerNumber); } return game.getTurn(); }
/** * is it my turn? */ public boolean isMyTurn() { if (game.isPhaseSimultaneous()) { return game.getTurnForPlayer(localPlayerNumber) != null; } return (game.getTurn() != null) && game.getTurn().isValid(localPlayerNumber, game); }
|| entity.isUnloadedThisTurn() || !getGame().getTurn().isValidEntity(entity, getGame())) && !getGame().isPhaseSimultaneous()){ msg.append("cannot be moved."); continue;
@Override public void gameTurnChange(GameTurnChangeEvent e) { // On simultaneous phases, each player ending their turn will generalte a turn change // We want to ignore turns from other players and only listen to events we generated boolean ignoreSimTurn = game.isPhaseSimultaneous() && (e.getPreviousPlayerId() != localPlayerNumber) && calculatedTurnThisPhase; if (isMyTurn() && !ignoreSimTurn) { calculatedTurnThisPhase = true; // Run bot's turn processing in a separate thread. // So calling thread is free to process the other actions. Thread worker = new Thread(new CalculateBotTurn(), getName() + " Turn " + game.getTurnIndex() + " Calc Thread" ); worker.start(); calculatedTurnsThisPhase++; } // unloading "stranded" units happens as part of a game turn change, so that's where we do it. if(canUnloadStranded()) { sendUnloadStranded(getStrandedEntities()); } }
if (game.isPhaseSimultaneous()) { turn = game.getTurnForPlayer(clientgui.getClient() .getLocalPlayer().getId());
if (clientgui.getClient().getGame().isPhaseSimultaneous() && (e.getPreviousPlayerId() != clientgui.getClient().getLocalPlayerNumber()) && (clientgui.getClient().getGame().getTurnIndex() != 0)) {
if (clientgui.getClient().getGame().isPhaseSimultaneous() && (e.getPreviousPlayerId() != clientgui.getClient().getLocalPlayerNumber()) && (clientgui.getClient().getGame().getTurnIndex() != 0)) {
if (clientgui.getClient().getGame().isPhaseSimultaneous() && (e.getPreviousPlayerId() != clientgui.getClient().getLocalPlayerNumber()) && (clientgui.getClient().getGame().getTurnIndex() != 0)) {
if (clientgui.getClient().getGame().isPhaseSimultaneous() && (e.getPreviousPlayerId() != clientgui.getClient().getLocalPlayerNumber()) && (clientgui.getClient().getGame().getTurnIndex() != 0)) {
if (clientgui.getClient().getGame().isPhaseSimultaneous() && (e.getPreviousPlayerId() != clientgui.getClient().getLocalPlayerNumber()) && (clientgui.getClient().getGame().getTurnIndex() != 0)) {