示例#1
0
        public async Task AddRoundValidationsAsync(RoundValidations roundValidations)
        {
            var player = await _playerStorage.GetAsync(roundValidations.GameId, roundValidations.PlayerId);

            player.Validations.Add(roundValidations);
            await _playerStorage.EditAsync(player);
        }
示例#2
0
文件: GameHub.cs 项目: BrunoRM/WeStop
        public async Task SendValidationsAsync(RoundValidations roundValidations)
        {
            await AddValidationsAndNotifyClientAsync(roundValidations);

            var gameId = roundValidations.GameId;
            var theme  = roundValidations.Theme;

            if (await _gameManager.CheckAllPlayersSendValidationsAsync(gameId, roundValidations.RoundNumber, theme))
            {
                await Clients.GameRoundGroup(gameId, roundValidations.RoundNumber).SendAsync("all_validations_sended", theme);

                await _gameManager.FinishValidationsForThemeAsync(gameId, theme);

                await _gameTimer.StartValidationForNextThemeAsync(gameId, roundValidations.RoundNumber);
            }
        }
示例#3
0
文件: GameHub.cs 项目: BrunoRM/WeStop
        private async Task AddValidationsAndNotifyClientAsync(RoundValidations roundValidations)
        {
            await _gameManager.AddRoundValidationsAsync(roundValidations);

            await Clients.Caller.SendAsync("im_send_validations");
        }
示例#4
0
文件: GameHub.cs 项目: BrunoRM/WeStop
 public async Task SendValidationsAfterTimeOverAsync(RoundValidations roundValidations)
 {
     await AddValidationsAndNotifyClientAsync(roundValidations);
 }