Exemplo n.º 1
0
        public void IsWolf_True1()
        {
            BitMatchNumCondition con = new BitMatchNumCondition()
            {
                MinNum = 2, MaxNum = 2
            };

            con.AddWerewolf(Agent.GetAgent(1));
            con.AddWerewolf(Agent.GetAgent(15));
            con.AddWerewolf(Agent.GetAgent(7));

            Assert.AreEqual(con.IsMatch(pattern), true);
        }
Exemplo n.º 2
0
        public void IsWolf_False2()
        {
            BitMatchNumCondition con = new BitMatchNumCondition()
            {
                MinNum = 3, MaxNum = 3
            };

            con.AddWerewolf(Agent.GetAgent(1));
            con.AddWerewolf(Agent.GetAgent(15));
            con.AddWerewolf(Agent.GetAgent(7));

            Assert.AreEqual(con.IsMatch(pattern), false);
        }
Exemplo n.º 3
0
        public void SpeedCheck1()
        {
            BitMatchNumCondition con = new BitMatchNumCondition()
            {
                MinNum = 2, MaxNum = 2
            };

            con.AddWerewolf(Agent.GetAgent(1));
            con.AddWerewolf(Agent.GetAgent(15));
            con.AddWerewolf(Agent.GetAgent(7));

            for (int i = 0; i < loop; i++)
            {
                bool a = con.IsMatch(pattern);
            }
        }
Exemplo n.º 4
0
        public void bitMatchNum条件_複数エージェント狼()
        {
            for (int i = 0; i < loop; i++)
            {
                Viewpoint viewpoint = new Viewpoint(gameSetting15, gameInfo15);

                BitMatchNumCondition con = new BitMatchNumCondition()
                {
                    MinNum = 1, MaxNum = 2
                };
                con.AddWerewolf(Agent.GetAgent(1));
                con.AddWerewolf(Agent.GetAgent(2));
                con.AddWerewolf(Agent.GetAgent(3));
                viewpoint.RemoveMatchPattern(con);

                Assert.AreEqual(viewpoint.MonsterSidePattern.Count, 2652);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 日付変更時(昼の開始時)の処理
        /// </summary>
        private void DayStart(GameInfo gameInfo)
        {
            // 昨日の情報を更新
            YesterdayInfo = TodayInfo;
            if (YesterdayInfo != null && YesterdayInfo.Day != 0 && YesterdayInfo.Day + 1 == gameInfo.Day)
            {
                TodayInfo.UpdateFromTomorrow(gameInfo);
            }

            // 日の情報を作成
            TodayInfo = new DayInfo(gameInfo);
            DayInfo.Add(gameInfo.Day, TodayInfo);

            // 死体で発見されたエージェントが人狼のパターンを削除する
            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])
            {
                BitMatchNumCondition condition = new BitMatchNumCondition()
                {
                    MinNum = 1, MaxNum = maxWolfNum,
                };
                foreach (Agent agent in gameInfo.AliveAgentList)
                {
                    condition.AddWerewolf(agent);
                }
                AllViewSystemInfo.RemoveNotMatchPattern(condition);
            }

            // 自分の占い判定の追加
            if (gameInfo.DivineResult != null)
            {
                MySeerJudge.Add(gameInfo.DivineResult);
            }

            // 自分の霊媒判定の追加
            if (gameInfo.MediumResult != null)
            {
                MyMediumJudge.Add(gameInfo.MediumResult);
            }

            // 自分の護衛履歴の追加
            if (gameInfo.GuardedAgent != null)
            {
                MyGuardHistory.Add(gameInfo.Day - 1, gameInfo.GuardedAgent);
            }

            // 護衛成功からのパターン削除
            if (gameInfo.GuardedAgent != null && gameInfo.LastDeadAgentList.Count <= 0)
            {
                BitCondition condition = new BitCondition();
                condition.AddWerewolf(gameInfo.GuardedAgent);

                AllViewSystemInfo.RemoveMatchPattern(condition);
            }


            talkOffset = 0;

            // debug

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