Exemplo n.º 1
0
 public JudgeToSend(Judge judge)
 {
     Day = judge.Day;
     Agent = judge.Agent.AgentIdx;
     Target = judge.Target.AgentIdx;
     Result = judge.Result.ToString();
     if (Result == null)
     {
         throw new AIWolfRuntimeException("judge result = null");
     }
 }
Exemplo n.º 2
0
        public override void Update(GameInfo gameInfo)
        {
            base.Update(gameInfo);

            List<Talk> talkList = gameInfo.TalkList;
            bool existInspectResult = false;

            // talkListからCO,占い結果の抽出
            for (int i = readTalkListNum; i < talkList.Count; i++)
            {
                Talk talk = talkList[i];
                Utterance utterance = new Utterance(talk.Content);
                switch (utterance.Topic)
                {
                    // カミングアウトの発話の場合
                    case Topic.COMINGOUT:
                        agi.ComingoutMap[talk.Agent] = utterance.Role;
                        break;
                    // 占い結果の発話の場合
                    case Topic.DIVINED:
                        // AGIのJudgeListに結果を加える
                        Agent seerAgent = talk.Agent;
                        Agent inspectedAgent = utterance.Target;
                        Species inspectResult = (Species)utterance.Result;
                        Judge judge = new Judge(Day, seerAgent, inspectedAgent, inspectResult);
                        agi.AddInspectJudgeList(judge);
                        existInspectResult = true;
                        break;
                }
            }
            readTalkListNum = talkList.Count;

            // 新しい占い結果があれば投票先を変える.(新たに黒判定が出た,または投票先のプレイヤーに白判定が出た場合)
            if (existInspectResult)
            {
                SetPlanningVoteAgent();
            }
        }
Exemplo n.º 3
0
        public override void Update(GameInfo gameInfo)
        {
            base.Update(gameInfo);

            List<Talk> talkList = gameInfo.TalkList;

            // talkListからCO,占い結果の抽出
            for (int i = readTalkListNum; i < talkList.Count; i++)
            {
                Talk talk = talkList[i];
                Utterance utterance = new Utterance(talk.Content);
                switch (utterance.Topic)
                {
                    // カミングアウトの発話の場合
                    // 自分以外で占い師COするプレイヤーが出たら投票先を変える
                    case Topic.COMINGOUT:
                        agi.ComingoutMap[talk.Agent] = utterance.Role;
                        if (utterance.Role == fakeRole)
                        {
                            SetPlanningVoteAgent();
                        }
                        break;

                    // 占い結果の発話の場合
                    // 人狼以外の占い,霊能結果で嘘だった場合は狂人だと判断
                    case Topic.DIVINED:
                        // AGIのJudgeListに結果を加える
                        Agent seerAgent = talk.Agent;
                        Agent inspectedAgent = utterance.Target;
                        Species inspectResult = (Species)utterance.Result;
                        Judge judge = new Judge(Day, seerAgent, inspectedAgent, inspectResult);
                        agi.AddInspectJudgeList(judge);

                        // ジャッジしたのが人狼以外の場合
                        if (!WolfList.Contains(judge.Agent))
                        {
                            Species judgeSpecies = judge.Result;
                            Species realSpecies;
                            if (WolfList.Contains(judge.Target))
                            {
                                realSpecies = Species.WEREWOLF;
                            }
                            else
                            {
                                realSpecies = Species.HUMAN;
                            }
                            if (judgeSpecies != realSpecies)
                            {
                                maybePossesedAgent = judge.Agent;
                                SetPlanningVoteAgent();
                            }
                        }
                        break;
                }
            }
            readTalkListNum = talkList.Count;
        }