예제 #1
0
        public async Task <InitRoundViewModel> InitRound(long gameId)
        {
            Game game = await _gameRepository.Get(gameId);

            List <GamePlayer>  players            = (await _gamePlayerRepository.GetAllForInitRound(gameId)).ToList();
            GamePlayer         human              = players.Where(m => m.Player.Type == (int)PlayerType.Human).First();
            GamePlayer         dealer             = players.Where(m => m.Player.Type == (int)PlayerType.Dealer).First();
            string             isGameOver         = IsGameOver(human, dealer);
            InitRoundViewModel initRoundViewModel = CustomMapper.GetInitRoundViewModel(game, players, isGameOver);

            return(initRoundViewModel);
        }