private bool isWolf(AdvanceGameInfo agi, Agent agent) { if (!agi.RoleMap.ContainsKey(agent)) { return(false); } return(agi.RoleMap[agent] == Role.WEREWOLF); }
private bool isHumanDead(AdvanceGameInfo agi, List <Agent> agentList) { foreach (Agent agent in agentList) { if (!isWolf(agi, agent) && !agi.AliveAgentList.Contains(agent)) { return(true); } } return(false); }
private bool isExistPossessed(AdvanceGameInfo agi, List <Agent> agentList) { int humanCnt = 0; foreach (Agent agent in agentList) { if (!isWolf(agi, agent)) { humanCnt++; } } return(humanCnt >= 2); }
public virtual void Initialize(GameInfo gameInfo, GameSetting gameSetting) { try { Agi = new AdvanceGameInfo(gameInfo, gameSetting); InitStrategy(gameInfo, gameSetting); } catch (Exception) { if (!isIgnoreError) { throw; } } }
public void update(AdvanceGameInfo agi) { bool isWinWolf = agi.AliveAgentList.Exists(agent => agi.RoleMap[agent] == Role.WEREWOLF); // 勝敗 foreach (KeyValuePair <Agent, Role> kv in agi.RoleMap) { statistics[kv.Key].gameCount++; statistics[kv.Key].roleCount[kv.Value] = statistics[kv.Key].roleCount[kv.Value] + 1; statistics[kv.Key].increaseCOCount(kv.Value, agi.GetComingOutRole(kv.Key)); if ((kv.Value.GetTeam() == Team.WEREWOLF) == isWinWolf) { statistics[kv.Key].increaseEventCount(kv.Value, "Win"); } else { statistics[kv.Key].increaseEventCount(kv.Value, "Lose"); } } // 投票 foreach (DayInfo dayInfo in agi.DayInfo.Values) { if (dayInfo.VoteList.Count > 0) { VoteAnalyzer va = dayInfo.SaidVote; foreach (Vote vote in dayInfo.VoteList[0]) { if (va.MaxVoteReceivedAgent.Contains(vote.Target)) { statistics[vote.Agent].increaseEventCount(agi.RoleMap[vote.Agent], "VoteToMax"); } else { statistics[vote.Agent].increaseEventCount(agi.RoleMap[vote.Agent], "VoteToNotMax"); } } } } // 1d発言 List <Agent> estAgentList = new List <Agent>(); foreach (ExtTalk talk in agi.DayInfo[1].TalkList) { if (talk.Content.Operator == Operator.NOP && talk.Content.Topic == Topic.ESTIMATE) { if (!estAgentList.Contains(talk.Agent)) { statistics[talk.Agent].increaseEventCount(agi.RoleMap[talk.Agent], "1d_Estimate"); estAgentList.Add(talk.Agent); } } } // 発言傾向 foreach (DayInfo dayInfo in agi.DayInfo.Values) { foreach (ExtTalk talk in dayInfo.TalkList) { int id = -1; if (talk.Content.Operator == Operator.NOP) { switch (talk.Content.Topic) { case Topic.Over: id = 1; break; case Topic.Skip: id = 2; break; case Topic.VOTE: id = 3; break; case Topic.ESTIMATE: id = (talk.Content.Role.GetTeam() == Team.WEREWOLF) ? 4 : 5; break; case Topic.COMINGOUT: id = 6; break; case Topic.DIVINED: case Topic.IDENTIFIED: case Topic.GUARDED: id = 7; break; case Topic.AGREE: id = 8; break; case Topic.DISAGREE: id = 9; break; default: break; } } else if (talk.Content.Operator == Operator.REQUEST) { id = 10; } if (id > 0) { statistics[talk.Agent].talkCount.increaseCount(talk.Day, talk.Turn, agi.GetComingOutRole(talk.Agent), agi.RoleMap[talk.Agent], id); } } } // 判定 foreach (Wepwawet.Lib.Judge judge in agi.SeerJudge) { if (judge.JudgeTalk.Day == 1) { if (judge.Result == Species.WEREWOLF) { statistics[judge.Agent].increaseEventCount(agi.RoleMap[judge.Agent], "1d_DevineBlack"); } else { statistics[judge.Agent].increaseEventCount(agi.RoleMap[judge.Agent], "1d_DevineWhite"); } } } }
public virtual void Initialize(GameInfo gameInfo, GameSetting gameSetting) { agi = new AdvanceGameInfo(gameInfo, gameSetting); InitStrategy(); }