예제 #1
0
 /// <summary>
 /// エージェントを追放されたエージェントのリストに追加する
 /// </summary>
 void AddExecutedAgent(Agent executedAgent)
 {
     if (executedAgent != null)
     {
         AliveOthers.Remove(executedAgent);
         if (!ExecutedAgents.Contains(executedAgent))
         {
             ExecutedAgents.Add(executedAgent);
         }
     }
 }
예제 #2
0
 /// <summary>
 /// エージェントを殺されたエージェントのリストに追加する
 /// </summary>
 void AddKilledAgent(Agent killedAgent)
 {
     if (killedAgent != null)
     {
         AliveOthers.Remove(killedAgent);
         if (!KilledAgents.Contains(killedAgent))
         {
             KilledAgents.Add(killedAgent);
         }
     }
 }
예제 #3
0
        /// <summary>
        /// Update AdditionalGameinfo.
        /// </summary>
        /// <param name="gameInfo">Game information.</param>
        public void Update(GameInfo gameInfo)
        {
            // 1日の最初の呼び出しではその日の初期化などを行う
            if (gameInfo.Day != day)
            {
                day          = gameInfo.Day;
                talkListHead = 0;
                AddExecutedAgent(gameInfo.ExecutedAgent); // 前日に追放されたエージェントを登録
                if (gameInfo.LastDeadAgentList.Count != 0)
                {
                    LastKilledAgent = gameInfo.LastDeadAgentList[0]; // 妖狐がいないので長さ最大1
                }
                if (LastKilledAgent != null)
                {
                    if (!KilledAgents.Contains(LastKilledAgent))
                    {
                        KilledAgents.Add(LastKilledAgent);
                    }
                    AliveOthers.Remove(LastKilledAgent);
                }
            }
            // (夜フェーズ限定)追放されたエージェントを登録
            AddExecutedAgent(gameInfo.LatestExecutedAgent);
            // talkListからカミングアウト,占い結果,霊媒結果を抽出
            for (int i = talkListHead; i < gameInfo.TalkList.Count; i++)
            {
                Talk    talk    = gameInfo.TalkList[i];
                Agent   talker  = talk.Agent;
                Content content = new Content(talk.Text);
                Agent   target  = content.Target;
                switch (content.Topic)
                {
                case Topic.COMINGOUT:
                    ComingoutMap[talker] = content.Role;
                    break;

                case Topic.DIVINED:
                    DivinationList.Add(new Judge(day, talker, content.Target, content.Result));
                    break;

                case Topic.IDENTIFIED:
                    IdentList.Add(new Judge(day, talker, target, content.Result));
                    break;

                case Topic.ESTIMATE:
                    if (target != null)
                    {
                        if (EstimateMap[target] == null)
                        {
                            EstimateMap[target] = new List <Talk>();
                        }
                        EstimateMap[target].Add(talk);
                    }
                    break;

                default:
                    break;
                }
            }
            talkListHead = gameInfo.TalkList.Count;
        }