/** * Returns an array of all general messages from the last adjudicated turn state. * * @param power the power to get results for * @param format one of the format constants * @return an array of <code>JdipResultAdapter</code>s */ public JdipResult[] getAllResultsForPower(JdipPower power, int format) { OrderFormatOptions ofo = this.ceateOrderFormat(format); TurnState state = world.getPreviousTurnState(world.getLastTurnState()); List allResults = state.getResultList(); ArrayList generalResults = new ArrayList(); Iterator it = allResults.iterator(); while (it.hasNext()) { JdipResult r = new JdipResult((Result) it.next(), ofo); // find all resluts for given power if (!r.isGeneralResult() && r.getPower().equals(power.getPowerName())) { generalResults.add(r); } } return toJdipResultArray(generalResults.toArray()); }
/** * Returns an array of all general messages from the last adjudicated turn state. * * @param format one of the format constants * @return an array of <code>JdipResultAdapter</code>s */ public JdipResult[] getAllGeneralResults(int format) { OrderFormatOptions ofo = this.ceateOrderFormat(format); TurnState state = world.getPreviousTurnState(world.getLastTurnState()); List allResults = state.getResultList(); ArrayList generalResults = new ArrayList(); Iterator it = allResults.iterator(); while (it.hasNext()) { JdipResult r = new JdipResult((Result) it.next(), ofo); // find all general resluts if (r.isGeneralResult()) { generalResults.add(r); } } return toJdipResultArray(generalResults.toArray()); }
/** * Gets the expanded name of the previous phase. This is the name of the phase associated with the * currently available results. * * @return phase name */ public String getLastPhaseTitle() { return world.getPreviousTurnState(world.getLastTurnState()).getPhase().toString(); }