public void actionPerformed(ActionEvent e) { myTarget = decodeTargetInfo(e.getActionCommand()); if (currentPanel instanceof FiringDisplay) { ((FiringDisplay) currentPanel).target(myTarget); } else if (currentPanel instanceof PhysicalDisplay) { ((PhysicalDisplay) currentPanel).target(myTarget); } else if (currentPanel instanceof TargetingPhaseDisplay) { ((TargetingPhaseDisplay) currentPanel).target(myTarget); } } });
/** * Jump to our next target. If there isn't one, well, don't do anything. */ private void jumpToNextTarget() { Entity targ = getNextTarget(); if (null == targ) { return; } clientgui.bv.centerOnHex(targ.getPosition()); clientgui.getBoardView().select(targ.getPosition()); target(targ); }
/** * Jump to our next target. If there isn't one, well, don't do anything. */ private void jumpToPrevTarget() { Entity targ = getPrevTarget(); if (targ == null) { return; } clientgui.bv.centerOnHex(targ.getPosition()); clientgui.getBoardView().select(targ.getPosition()); target(targ); }
private void selectTarget() { Vector<Entity> list = new Vector<Entity>(); IPlayer localPlayer = client.getLocalPlayer(); boolean friendlyFire = (game.getOptions() .booleanOption(OptionsConstants.BASE_FRIENDLY_FIRE)); for (Entity en : game.getEntitiesVector(coords)) { // Only add the unit if it's actually visible // With double blind on, the game may have unseen units if ((en.isEnemyOf(myEntity) || friendlyFire) && !en.equals(myEntity) && !en.isSensorReturn(localPlayer) && en.hasSeenEntity(localPlayer)) { list.add(en); } } if (list.size() == 1) { myTarget = selectedEntity = list.firstElement(); // gui.bv.centerOnHex(myTarget.getPosition()); // gui.getBoardView().select(myTarget.getPosition()); if (currentPanel instanceof FiringDisplay) { FiringDisplay panel = (FiringDisplay) currentPanel; panel.target(myTarget); } else if (currentPanel instanceof PhysicalDisplay) { ((PhysicalDisplay) currentPanel).target(myTarget); } else if (currentPanel instanceof TargetingPhaseDisplay) { ((TargetingPhaseDisplay) currentPanel).target(myTarget); } } }
@Override public void hexSelected(BoardViewEvent b) { // Are we ignoring events? if (isIgnoringEvents()) { return; } final Client client = clientgui.getClient(); if (client.isMyTurn() && (b.getCoords() != null) && (ce() != null) && !b.getCoords().equals(ce().getPosition())) { if (shiftheld) { updateFlipArms(false); torsoTwist(b.getCoords()); } else if (phase == IGame.Phase.PHASE_TARGETING) { target(new HexTarget(b.getCoords(), ce().getGame().getBoard(), Targetable.TYPE_HEX_ARTILLERY)); } else { target(chooseTarget(b.getCoords())); } } }
/** * Does end turn stuff. */ private void endMyTurn() { // end my turn, then. Entity next = clientgui.getClient().getGame() .getNextEntity(clientgui.getClient().getGame().getTurnIndex()); if ((phase == clientgui.getClient().getGame().getPhase()) && (null != next) && (null != ce()) && (next.getOwnerId() != ce().getOwnerId())) { clientgui.setDisplayVisible(false); } cen = Entity.NONE; target(null); clientgui.getBoardView().select(null); clientgui.getBoardView().highlight(null); clientgui.getBoardView().cursor(null); clientgui.bv.clearFiringSolutionData(); clientgui.bv.clearMovementData(); clientgui.bv.clearFieldofF(); clientgui.setSelectedEntityNum(Entity.NONE); disableButtons(); }
target(null); clientgui.getBoardView().highlight(ce().getPosition()); clientgui.getBoardView().select(null);