Ejemplo n.º 1
0
        public string AddPlayer(string type, string username)
        {
            var player = playerFactory.CreatePlayer(type, username);

            playerRepository.Add(player);

            return($"Successfully added player of type {type} with username: {username}");
        }
Ejemplo n.º 2
0
        public string AddPlayer(string type, string username)
        {
            IPlayer player = playerFactory.CreatePlayer(type, username);

            this.playerRepository.Add(player);

            return(string.Format(ConstantMessages.SuccessfullyAddedPlayer, type, username));
        }
Ejemplo n.º 3
0
        public string AddPlayer(string type, string username)
        {
            if (playerRepository.Players.Any(p => p.Username == username))
            {
                throw new ArgumentException($"Player {username} already exists!");
            }

            var player = playerFactory.CreatePlayer(type, username);

            playerRepository.Add(player);

            return($"Successfully added player of type {type} with username: {username}");
        }