コード例 #1
0
        public async Task StartDayPhase()
        {
            var lastNightVictim = Phases.LastOrDefault(p => p.Phase == PhaseType.Night)?.Target;
            await DayChannel.SendMessageAsync(GameElement.PhasePhrase(PhaseType.Day));

            string dayMessage = lastNightVictim != null
                    ? GameElement.MurderScene(lastNightVictim.Username)
                    : GameElement.NoMurder();

            await DayChannel.SendMessageAsync(dayMessage);

            if (InformedGroupWins(ActiveGame))
            {
                await EndGameWithWinner(GroupType.Informed);
            }
            else
            {
                await DayChannel.SendMessageAsync(GameElement.PhaseInstruction(PhaseType.Day));
                await UnlockChannelForUsers(DayChannel, ActiveGame.Players.Where(p => p.Active).Select(p => p.User));
            }
        }