예제 #1
0
파일: DayInfo.cs 프로젝트: yoshinobc/aiwolf
        /// <summary>
        /// 情報を更新する
        /// </summary>
        /// <param name="gameInfo"></param>
        public void Update(GameInfo gameInfo)
        {
            // Talk、Whisperを追加登録する
            ApendTalkList(gameInfo);

            if (NightAliveAgent == null)
            {
                // 追放再投票になった直後の処理
                // 第3回大会では再投票1回なので大丈夫だが、2回以上の場合は要改良
                if (gameInfo.LatestExecutedAgent != null && gameInfo.LatestVoteList.Count > 0)
                {
                    VoteList.Add(gameInfo.LatestVoteList);
                }

                // 襲撃再投票になった直後の処理
                // 第3回大会では再投票1回なので大丈夫だが、2回以上の場合は要改良
                if (gameInfo.LatestAttackVoteList.Count > 0)
                {
                    AttackVoteList.Add(gameInfo.LatestAttackVoteList);
                }

                // 夜になった直後の処理
                if (gameInfo.LatestExecutedAgent != null)
                {
                    ExecuteAgent    = gameInfo.LatestExecutedAgent;
                    NightAliveAgent = gameInfo.AliveAgentList;

                    VoteList.Add(gameInfo.VoteList);
                }
            }
        }
예제 #2
0
파일: DayInfo.cs 프로젝트: yoshinobc/aiwolf
        /// <summary>
        /// 情報を更新する(翌日のデータから)
        /// </summary>
        public void UpdateFromTomorrow(GameInfo gameInfo)
        {
            AttackDeadAgent = gameInfo.LastDeadAgentList;

            GuardAgent     = gameInfo.GuardedAgent;
            TryAttackAgent = gameInfo.AttackedAgent;

            if (NightAliveAgent == null)
            {
                // 夜のデータが設定されていない場合(夜の行動が無い役職)
                ExecuteAgent = gameInfo.ExecutedAgent;

                NightAliveAgent = new List <Agent>(DayTimeAliveAgent);
                NightAliveAgent.Remove(ExecuteAgent);

                VoteList.Add(gameInfo.VoteList);
            }
            else
            {
                // 夜のデータが設定されている場合(夜の行動が有る役職)
                if (gameInfo.AttackVoteList.Count > 0)
                {
                    AttackVoteList.Add(gameInfo.AttackVoteList);
                }
            }
        }
예제 #3
0
 public void AddAttack(Vote attack)
 {
     AttackVoteList.Add(attack);
 }