예제 #1
0
        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();
        }
예제 #2
0
        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));
        }
예제 #3
0
        public bool CheckPhase(PhaseResourceModel phaseResourceModel)
        {
            Phase phase        = mapper.Map <Phase>(phaseResourceModel);
            bool  isValidPhase = gameService.CheckPhase(phase);

            logger.LogInformation($"Phase is valid: {isValidPhase}");
            return(isValidPhase);
        }