public async Task AddRoundValidationsAsync(RoundValidations roundValidations) { var player = await _playerStorage.GetAsync(roundValidations.GameId, roundValidations.PlayerId); player.Validations.Add(roundValidations); await _playerStorage.EditAsync(player); }
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); } }
private async Task AddValidationsAndNotifyClientAsync(RoundValidations roundValidations) { await _gameManager.AddRoundValidationsAsync(roundValidations); await Clients.Caller.SendAsync("im_send_validations"); }
public async Task SendValidationsAfterTimeOverAsync(RoundValidations roundValidations) { await AddValidationsAndNotifyClientAsync(roundValidations); }