public async Task UpdatePhase(string gameId, string playerId, PhaseResourceModel phase) { gameService.UpdatePlayerPhase(gameId, playerId, mapper.Map <Phase>(phase)); await Clients.OthersInGroup(gameId).RequestCompetitors(); await Clients.Group(gameId).UpdateSelf(); }
public async Task PlayPhase(string gameId, string playerId, PhaseResourceModel phaseResourceModel) { Phase phase = mapper.Map <Phase>(phaseResourceModel); gameService.PlayPhase(gameId, playerId, phase); Player player = gameService.GetPlayer(gameId, playerId); await Clients.OthersInGroup(gameId).UpdateCompetitors(mapper.Map <CompetitorResourceModel>(player)); }
public bool CheckPhase(PhaseResourceModel phaseResourceModel) { Phase phase = mapper.Map <Phase>(phaseResourceModel); bool isValidPhase = gameService.CheckPhase(phase); logger.LogInformation($"Phase is valid: {isValidPhase}"); return(isValidPhase); }