예제 #1
0
        private async Task <List <Player> > CreatePlayerList(string humanName, int amountOfBots)
        {
            var    players = new List <Player>();
            Player human   = CustomMapper.MapPlayer(humanName, PlayerType.Human);

            players.Add(human);

            Player dealer = CustomMapper.MapPlayer(PlayerName.DealerName, PlayerType.Dealer);

            players.Add(dealer);

            for (int i = 0; i < amountOfBots; i++)
            {
                Player bot = CustomMapper.MapPlayer(PlayerName.BotName + i, PlayerType.Bot);
                players.Add(bot);
            }

            players = await _playerRepository.CreateMany(players);

            return(players);
        }