コード例 #1
0
ファイル: KogSeerPlayer.java プロジェクト: ry0u/jinrou-aiwolf
  @Override
  public Agent vote() {

    List<Agent> whiteAgent = new ArrayList<>();
    List<Agent> blackAgent = new ArrayList<>();

    for (Judge j : getMyJudgeList()) {
      if (getLatestDayGameInfo().getAliveAgentList().contains(judge.getTarget())) {
        switch (j.getResult()) {
          case HUMAN:
            whiteAgent.add(judge.getTarget());
            break;
          case WEREWOLF:
            blackAgent.add(judge.getTarget());
            break;
        }
      }
    }

    if (blackAgent.size() > 0) {
      return randomSelect(blackAgent);
    } else {
      List<Agent> voteCandidates = new ArrayList<Agent>();
      voteCandidates.addAll(getLatestDayGameInfo().getAliveAgentList());
      voteCandidates.remove(getMe());
      voteCandidates.removeAll(whiteAgent);

      return randomSelect(voteCandidates);
    }
  }
コード例 #2
0
ファイル: KogSeerPlayer.java プロジェクト: ry0u/jinrou-aiwolf
  @Override
  public String talk() {
    if (!isComingout) {
      isComingout = true;
      String ret = TemplateTalkFactory.comingout(getMe(), getMyRole());
      return ret;
    }

    if (!tellMyJudge) {
      tellMyJudge = true;
      Judge judge = this.getLatestDayGameInfo().getDivineResult();
      if (judge != null) {
        String ret = TemplateTalkFactory.divined(judge.getTarget(), judge.getResult());
        return ret;
      }
    }

    return Talk.OVER;
  }