예제 #1
0
파일: JdipWorld.java 프로젝트: js-duke/kdip
  /**
   * 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());
  }
예제 #2
0
파일: JdipWorld.java 프로젝트: js-duke/kdip
  /**
   * 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());
  }