Exemple #1
0
 public List <Player> CreateGame()
 {
     if (gameStatuEnum == GameStatuEnum.Played)
     {
         playerRepository.CreateCasinoPlayer();
         playerRepository.AddNewPlayer();
         gameStatuEnum = GameStatuEnum.IsPlayed;
         DealingCards();
     }
     return(playerRepository.GetPlayers());
 }
Exemple #2
0
        public void StartGame(List <string> playerNames)
        {
            int _playerAmount = playerNames.Count;

            for (int player = 0; player < _playerAmount; player++)
            {
                _playerRepository.AddNewPlayer(playerNames[player]);
            }
        }
Exemple #3
0
        public void CanCreatePlayer()
        {
            _playerRepository = new PlayerRepository();

            _playerRepository.AddNewPlayer("Pelle");

            List <Player> _players = _playerRepository.GetPlayers();

            Assert.AreEqual(_players[0].Name, "Pelle");
        }
 public Player Post([FromBody] Player player)
 {
     player = _repository.AddNewPlayer(player);
     return(player);
 }