Пример #1
0
        public void Exec(TalkGeneratorArgs args)
        {
            isSuccess = false;
            talkList  = new Dictionary <string, double>();

            // 日が変わったら宣言していない状態に戻す
            if (args.Agi.Day > latestUpdateDay)
            {
                voteTarget = null;
            }

            // 4人以下の場合は宣言しない
            if (args.Agi.TodayInfo.DayTimeAliveAgent.Count <= 4)
            {
                return;
            }

            Agent newTarget = args.ActionPlan.VoteTarget;

            if (newTarget != null && !newTarget.Equals(voteTarget))
            {
                voteTarget = newTarget;

                latestUpdateDay = args.Agi.Day;
                isSuccess       = true;

                VoteContentBuilder    voteBuilder = new VoteContentBuilder(newTarget);
                RequestContentBuilder reqBuilder  = new RequestContentBuilder(null, new Content(voteBuilder));
                talkList.Add(new Content(reqBuilder).Text, 1.0);
            }
        }
Пример #2
0
        public void Exec(TalkGeneratorArgs args)
        {
            isSuccess = false;
            talkList  = new Dictionary <string, double>();

            // 宣言済みの投票先
            Agent voteTarget = null;

            if (args.Agi.TodayInfo.SaidVote.VoteMap.ContainsKey(args.Agi.Me))
            {
                voteTarget = args.Agi.TodayInfo.SaidVote.VoteMap[args.Agi.Me];
            }

            Agent newTarget = args.ActionPlan.VoteTarget;

            if (newTarget != null && (IsForce || !newTarget.Equals(voteTarget)))
            {
                voteTarget = newTarget;

                isSuccess = true;

                VoteContentBuilder builder = new VoteContentBuilder(newTarget);
                talkList.Add(new Content(builder).Text, 1.0);
            }
        }