public void setUsedThisRound(boolean usedThisRound) { this.usedThisRound = usedThisRound; if (usedThisRound) { phase = entity.game.getPhase(); } else { phase = IGame.Phase.PHASE_UNKNOWN; } }
@Override public boolean isObserver() { if ((game != null) && (game.getPhase() == IGame.Phase.PHASE_VICTORY)) { return false; } return observer; }
private boolean shouldIgnoreKeyCommands() { return getChatterBoxActive() || !isVisible() || (game.getPhase() == Phase.PHASE_LOUNGE) || (game.getPhase() == Phase.PHASE_END_REPORT) || (game.getPhase() == Phase.PHASE_MOVEMENT_REPORT) || (game.getPhase() == Phase.PHASE_TARGETING_REPORT) || (game.getPhase() == Phase.PHASE_FIRING_REPORT) || (game.getPhase() == Phase.PHASE_PHYSICAL_REPORT) || (game.getPhase() == Phase.PHASE_OFFBOARD_REPORT) || (game.getPhase() == Phase.PHASE_INITIATIVE_REPORT) || shouldIgnoreKeys; }
@Override public void gameReport(GameReportEvent e) { if (game.getPhase() == IGame.Phase.PHASE_INITIATIVE_REPORT) { // Opponent has used tactical genius, must press // "Done" again to advance past initiative report. sendDone(true); flushConn(); } }
public void valueChanged(ListSelectionEvent event) { if (event.getValueIsAdjusting()) { return; } if (event.getSource().equals(clientgui.mechD.wPan.weaponList) && (clientgui.getClient().getGame().getPhase() == Phase.PHASE_FIRING)) { // If we aren't in the firing phase, there's no guarantee that cen // is set properly, hence we can't update // update target data in weapon display updateTarget(); } }
public void updateButtonPanel(IGame.Phase phase) { if ((currPhaseDisplay != null) && client.getGame().getPhase().equals(phase)) { currPhaseDisplay.setupButtonPanel(); } }
public void FieldofFire(Entity unit, int[][] ranges, int arc, int loc, int facing) { // do nothing here outside the arty targeting phase if (!(clientgui.getClient().getGame().getPhase() == Phase.PHASE_TARGETING)) return; clientgui.bv.fieldofFireUnit = unit; clientgui.bv.fieldofFireRanges = ranges; clientgui.bv.fieldofFireWpArc = arc; clientgui.bv.fieldofFireWpLoc = loc; clientgui.bv.setWeaponFieldofFire(facing, unit.getPosition()); }
public void FieldofFire(Entity unit, int[][] ranges, int arc, int loc, int facing) { // do nothing here outside the movement phase if (!(clientgui.getClient().getGame().getPhase() == Phase.PHASE_FIRING)) return; clientgui.bv.fieldofFireUnit = unit; clientgui.bv.fieldofFireRanges = ranges; clientgui.bv.fieldofFireWpArc = arc; clientgui.bv.fieldofFireWpLoc = loc; clientgui.bv.setWeaponFieldofFire(facing, unit.getPosition()); }
@Override public void gamePhaseChange(GamePhaseChangeEvent e) { DeploymentDisplay.this.clientgui.bv.markDeploymentHexesFor(null); // In case of a /reset command, ensure the state gets reset if (clientgui.getClient().getGame().getPhase() == IGame.Phase.PHASE_LOUNGE) { endMyTurn(); } // Are we ignoring events? if (isIgnoringEvents()) { return; } if (clientgui.getClient().getGame().getPhase() == IGame.Phase.PHASE_DEPLOYMENT) { setStatusBarText(Messages .getString("DeploymentDisplay.waitingForDeploymentPhase")); //$NON-NLS-1$ } }
/** * Check to see if the HexImageCache should be cleared because of * field-of-view changes. */ public void checkFoVHexImageCacheClear() { boolean darken = GUIPreferences.getInstance().getBoolean( GUIPreferences.FOV_DARKEN); boolean highlight = GUIPreferences.getInstance().getBoolean( GUIPreferences.FOV_HIGHLIGHT); if ((game.getPhase() == Phase.PHASE_MOVEMENT) && (darken || highlight)) { clearHexImageCache(); } }
@Override public void gamePhaseChange(GamePhaseChangeEvent e) { // Are we ignoring events? if (isIgnoringEvents()) { return; } if (clientgui.getClient().isMyTurn() && (clientgui.getClient().getGame().getPhase() != IGame.Phase.PHASE_DEPLOY_MINEFIELDS)) { endMyTurn(); } if (clientgui.getClient().getGame().getPhase() == IGame.Phase.PHASE_DEPLOY_MINEFIELDS) { setStatusBarText(Messages .getString("DeployMinefieldDisplay.waitingForDeploymentPhase")); //$NON-NLS-1$ } }
@Override public void gamePhaseChange(GamePhaseChangeEvent e) { // Are we ignoring events? if (isIgnoringEvents()) { return; } if (clientgui.getClient().isMyTurn() && (clientgui.getClient().getGame().getPhase() != phase)) { endMyTurn(); } // if we're ending the firing phase, unregister stuff. if (clientgui.getClient().getGame().getPhase() == phase) { setStatusBarText(Messages .getString("TargetingPhaseDisplay.waitingForFiringPhase")); //$NON-NLS-1$ } }
public void resetButtons() { resetReadyButton(); if ((clientgui.getClient().getGame().getPhase() == IGame.Phase.PHASE_INITIATIVE_REPORT) && clientgui.getClient().getGame().hasTacticalGenius(clientgui.getClient().getLocalPlayer())) { showRerollButton(true); } else { showRerollButton(false); } rerollInitiativeB.setEnabled(true); }
/** * Determines if this object can accept the given unit. The unit may not be * of the appropriate type or there may be no room for the unit. * * @param unit * - the <code>Entity</code> to be loaded. * @return <code>true</code> if the unit can be loaded, <code>false</code> * otherwise. */ @Override public boolean canLoad(Entity unit, boolean checkFalse) { // capital fighters can load other capital fighters (becoming squadrons) // but not in the deployment phase if (isCapitalFighter() && !unit.isEnemyOf(this) && unit.isCapitalFighter() && (getId() != unit.getId()) && (game.getPhase() != IGame.Phase.PHASE_DEPLOYMENT)) { return true; } return super.canLoad(unit, checkFalse); }
@Override public void gamePhaseChange(GamePhaseChangeEvent e) { // This is a really lame place for this, but I couldn't find a // better one without making massive changes (which didn't seem // worth it for one little feature). if (bv.getLocalPlayer() != client.getLocalPlayer()) { // The adress based comparison is somewhat important. // Use of the /reset command can cause the player to get reset, // and the equals function of Player isn't powerful enough. bv.setLocalPlayer(client.getLocalPlayer()); } // Make sure the ChatterBox starts out deactived. bv.setChatterBoxActive(false); // Swap to this phase's panel. switchPanel(getClient().getGame().getPhase()); menuBar.setPhase(getClient().getGame().getPhase()); validate(); cb.moveToEnd(); }
public void FieldofFire(Entity unit, int[][] ranges, int arc, int loc) { // do nothing here outside the movement phase if (!(clientgui.getClient().getGame().getPhase() == Phase.PHASE_MOVEMENT)) return; clientgui.bv.fieldofFireUnit = unit; clientgui.bv.fieldofFireRanges = ranges; clientgui.bv.fieldofFireWpArc = arc; clientgui.bv.fieldofFireWpLoc = loc; // If the unit is the current unit, then work with // the current considered movement if (unit.equals(ce())) clientgui.bv.setWeaponFieldofFire(ce(), cmd); else clientgui.bv.setWeaponFieldofFire(unit.getFacing(), unit.getPosition()); }
@Override public void gamePhaseChange(GamePhaseChangeEvent e) { // Are we ignoring events? if (isIgnoringEvents()) { return; } if (clientgui.getClient().getGame().getPhase() == IGame.Phase.PHASE_LOUNGE) { refreshDoneButton(); refreshGameSettings(); refreshPlayerInfo(); refreshTeams(); refreshCamos(); refreshEntities(); } }
/** * Called when the user selects the "View->Game Options" menu item. */ private void showOptions() { if (client.getGame().getPhase() == IGame.Phase.PHASE_LOUNGE) { getGameOptionsDialog().setEditable(true); } else { getGameOptionsDialog().setEditable(false); } // Display the game options dialog. getGameOptionsDialog().update(client.getGame().getOptions()); getGameOptionsDialog().setVisible(true); }
/** * Clears out old deployment data and disables relevant buttons. */ private void endMyTurn() { // end my turn, then. Entity next = clientgui.getClient().getGame() .getNextEntity(clientgui.getClient().getGame().getTurnIndex()); if ((IGame.Phase.PHASE_DEPLOYMENT == clientgui.getClient().getGame() .getPhase()) && (null != next) && (null != ce()) && (next.getOwnerId() != ce().getOwnerId())) { clientgui.setDisplayVisible(false); } cen = Entity.NONE; clientgui.getBoardView().select(null); clientgui.getBoardView().highlight(null); clientgui.getBoardView().cursor(null); clientgui.bv.markDeploymentHexesFor(null); clientgui.setSelectedEntityNum(Entity.NONE); disableButtons(); }