예제 #1
0
        public void matchNum条件_複数エージェント狼()
        {
            for (int i = 0; i < loop; i++)
            {
                Viewpoint viewpoint = new Viewpoint(gameSetting15, gameInfo15);

                MatchNumCondition con = new MatchNumCondition()
                {
                    MinNum = 1, MaxNum = 2
                };
                con.AddCondition(RoleCondition.GetCondition(Agent.GetAgent(1), Role.WEREWOLF));
                con.AddCondition(RoleCondition.GetCondition(Agent.GetAgent(2), Role.WEREWOLF));
                con.AddCondition(RoleCondition.GetCondition(Agent.GetAgent(3), Role.WEREWOLF));
                viewpoint.RemoveMatchPattern(con);

                Assert.AreEqual(viewpoint.MonsterSidePattern.Count, 2652);
            }
        }
예제 #2
0
        /// <summary>
        /// 日付変更時(昼の開始時)の処理
        /// </summary>
        private void DayStart(GameInfo gameInfo)
        {
            // 死体で発見されたエージェントが人狼のパターンを削除する
            foreach (Agent agent in gameInfo.LastDeadAgentList)
            {
                ICondition condition = RoleCondition.GetCondition(agent, Role.WEREWOLF);
                AllViewSystemInfo.RemoveMatchPattern(condition);
            }

            //TODO 飽和が早い配役対応 (15人村→4日目から)(5人村→1狼のため必要無し)
            // 人狼生存人数がおかしいパターンを削除する
            int maxWolfNum = (gameInfo.AliveAgentList.Count - 1) / 2;

            maxWolfNum = Math.Min(maxWolfNum, GameSetting.RoleNumMap[Role.WEREWOLF]);
            if (gameInfo.Day > GameSetting.RoleNumMap[Role.WEREWOLF])
            {
                MatchNumCondition condition = new MatchNumCondition()
                {
                    MinNum = 1, MaxNum = maxWolfNum,
                };
                foreach (Agent agent in gameInfo.AliveAgentList)
                {
                    condition.AddCondition(RoleCondition.GetCondition(agent, Role.WEREWOLF));
                }
                AllViewSystemInfo.RemoveNotMatchPattern(condition);
            }

            talkOffset = 0;

            // debug

            /*
             * Console.Write(gameInfo.Day + "日目 : ");
             * Console.Write(SelfViewSystemInfo.MonsterSidePattern.Count);
             * Console.Write(" / ");
             * Console.Write(AllViewSystemInfo.MonsterSidePattern.Count);
             * Console.WriteLine("");
             */
        }