コード例 #1
0
        public async Task PlayAsync()
        {
            try
            {
                CreateStack();

                WriteDebug($"Laps : {Laps}");

                var done = false;

                while (Moments.Count > 0 && !done)
                {
                    WriteDebug($"Moment Active : {Moments.Peek()}");

                    foreach (var moment in Moments.ToArray())
                    {
                        WriteDebug($"Moment in pile : {moment}");
                    }


                    switch (Moments.Pop())
                    {
                    case Moment.Voting:
                        await BotFunctions.DailyVote();

                        break;

                    case Moment.HunterDead:
                        await Hunter.HunterDeath();

                        break;

                    case Moment.EndNight:
                        await BotFunctions.EndNight();

                        await BotFunctions.DayAnnoucement();

                        break;

                    case Moment.NightPhase1:
                        await BotFunctions.NightAnnoucement();

                        await Wolf.WolfVote();

                        await Seer.SeerAction();

                        await LittleGirl.LittleGirlAction();

                        break;

                    case Moment.NightPhase2:
                        await Witch.WitchMoment();

                        break;

                    case Moment.Election:
                        await BotFunctions.Elections();

                        break;

                    case Moment.Cupid:
                        await Cupidon.CupidonChoice();

                        break;

                    case Moment.End:
                        done = true;
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }