예제 #1
0
  @Override
  public void update(GameInfo gameInfo) {
    super.update(gameInfo);

    List<Talk> talkList = gameInfo.getTalkList();

    for (int i = readTalkNum; i < talkList.size(); i++) {
      Talk talk = talkList.get(i);
      Utterance utterance = new Utterance(talk.getContent());

      if (utterance.getTopic().equals(Topic.COMINGOUT)) {
        this.comingoutRole.put(utterance.getTarget(), utterance.getRole());
        if (utterance.getRole().equals(Role.SEER)) {
          this.isAgainstSeer = true;
        }
      }

      if (utterance.getTopic().equals(Topic.DIVINED)) {
        if (!talk.getAgent().equals(this.getMe())) {
          Judge judge =
              new Judge(
                  getLatestDayGameInfo().getDay(),
                  talk.getAgent(),
                  utterance.getTarget(),
                  utterance.getResult());
          this.anotherJudgeList.add(judge);
        }
      }
    }
  }
예제 #2
0
  @Override
  public void update(GameInfo gameInfo) {
    super.update(gameInfo);
    List<Talk> talkList = gameInfo.getTalkList();

    for (int i = readTalkNum; i < talkList.size(); i++) {
      Talk talk = talkList.get(i);
      Utterance utterance = new Utterance(talk.getContent());

      switch (utterance.getTopic()) {
        case COMINGOUT:
          if (utterance.getRole() == Role.SEER && !talk.getAgent().equals(getMe())) {
            fakeSeerCOAgent.add(utterance.getTarget());
          }
          break;
        case DIVINED:
          COResult.setDevineResult(talk.getAgent(), utterance.getTarget(), utterance.getResult());
          break;
        case AGREE:
          break;
        case ATTACK:
          break;
        case DISAGREE:
          break;
        case ESTIMATE:
          break;
        case GUARDED:
          break;
        case INQUESTED:
          COResult.setInquestResult(talk.getAgent(), utterance.getTarget(), utterance.getResult());
          break;
        case OVER:
          break;
        case SKIP:
          break;
        case VOTE:
          break;
        default:
          break;
      }
      readTalkNum++;
    }
  }
예제 #3
0
  @Override
  public Agent guard() {
    List<Agent> guardCandidates = new ArrayList<>();
    Agent guardTarget;
    for (Talk talk : this.getTalkList(Topic.COMINGOUT)) {
      Utterance utterance = new Utterance(talk.getContent());
      if (utterance.getRole() == Role.SEER) {
        guardCandidates.add(talk.getAgent());
      }
    }
    removeDeadAgent(guardCandidates);
    if (!guardCandidates.isEmpty()) {
      guardTarget = randomSelect(guardCandidates);
      return guardTarget;
    }

    guardCandidates = getLatestDayGameInfo().getAliveAgentList();
    guardTarget = randomSelect(guardCandidates);
    return guardTarget;
  }