public void IsNotPossessed_False1() { BitCondition con = new BitCondition(); con.AddNotPossessed(Agent.GetAgent(7)); Assert.AreEqual(con.IsMatch(pattern), false); }
public void IsNotPossessed_True() { BitCondition con = new BitCondition(); con.AddNotPossessed(Agent.GetAgent(8)); Assert.AreEqual(con.IsMatch(pattern), true); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="gameInfo"></param> /// <param name="gameSetting"></param> public AdvanceGameInfo(GameInfo gameInfo, GameSetting gameSetting) { // ゲーム設定を保管 GameSetting = gameSetting; latestGameInfo = gameInfo; AgentList = gameInfo.AgentList; // 全視点情報・自分視点情報の初期化 AllViewSystemInfo = new Viewpoint(GameSetting, gameInfo); AllViewTrustInfo = new Viewpoint(AllViewSystemInfo); SelfViewSystemInfo = new Viewpoint(AllViewSystemInfo); SelfViewTrustInfo = new Viewpoint(AllViewSystemInfo); AllViewSystemInfo.AddInclusionViewpoint(AllViewTrustInfo); AllViewSystemInfo.AddInclusionViewpoint(SelfViewSystemInfo); AllViewTrustInfo.AddInclusionViewpoint(SelfViewTrustInfo); SelfViewSystemInfo.AddInclusionViewpoint(SelfViewTrustInfo); if (MyRole == Role.POSSESSED) { SelfPossessedViewTrustInfo = new Viewpoint(AllViewTrustInfo); AllViewTrustInfo.AddInclusionViewpoint(SelfPossessedViewTrustInfo); } // 自分視点から自分が人外の内訳を削除する BitCondition condition = new BitCondition(); condition.AddWerewolfTeam(gameInfo.Agent); SelfViewSystemInfo.RemoveMatchPattern(condition); // 自分狂人視点から自分が狂人でない内訳を削除する if (MyRole == Role.POSSESSED) { condition = new BitCondition(); condition.AddNotPossessed(gameInfo.Agent); SelfPossessedViewTrustInfo.RemoveMatchPattern(condition); } }
public void Update(GuessStrategyArgs args) { // 実行結果のクリア guessList.Clear(); // 役職CO者を取得 List <Agent> seerList = args.Agi.GetComingOutAgent(Role.SEER); List <Agent> mediumList = args.Agi.GetComingOutAgent(Role.MEDIUM); List <Agent> bodyguardList = args.Agi.GetComingOutAgent(Role.BODYGUARD); // 占い師が全偽のパターン if (seerList.Count > 0) { BitCondition con = new BitCondition(); foreach (Agent agent in seerList) { con.AddWerewolfTeam(agent); } guessList.Add(new PartGuess() { Condition = con, Correlation = 0.2, }); } // 5人村-狂人が騙っていないパターン if (args.Agi.AgentList.Count == 5 && seerList.Count > 0) { BitCondition con = new BitCondition(); foreach (Agent agent in seerList) { con.AddNotPossessed(agent); } guessList.Add(new PartGuess() { Condition = con, Correlation = 0.3, }); } // 15人村-狂人が騙っていないパターン if (args.Agi.AgentList.Count == 15 && seerList.Count + mediumList.Count >= 4) { BitCondition con = new BitCondition(); foreach (Agent agent in seerList) { con.AddNotPossessed(agent); } foreach (Agent agent in mediumList) { con.AddNotPossessed(agent); } guessList.Add(new PartGuess() { Condition = con, Correlation = 0.3, }); } // 霊媒師が全偽のパターン if (mediumList.Count > 0) { BitCondition con = new BitCondition(); foreach (Agent agent in mediumList) { con.AddWerewolfTeam(agent); } guessList.Add(new PartGuess() { Condition = con, Correlation = 0.1, }); } // 実行成功にする isSuccess = true; }