public ManagerController(PlayerRepository playerRepository, CardRepository cardRepository, CardFactory cardFactory, PlayerFactory playerFactory)
 {
     this.playerRepository = playerRepository;
     this.cardRepository   = cardRepository;
     this.playerFactory    = playerFactory;
     this.cardFactory      = cardFactory;
 }
 public ManagerController()
 {
     this.playerFactory    = new PlayerFactory();
     this.cardFactory      = new CardFactory();
     this.playerRepository = new PlayerRepository();
     this.cardRepository   = new CardRepository();
     this.battleField      = new BattleField();
 }
示例#3
0
 public ManagerController()
 {
     playerRepository = new PlayerRepository();
     cardRepository   = new CardRepository();
     playerFactory    = new PlayerFactory();
     cardFactory      = new CardFactory();
     battleField      = new BattleField();
 }
示例#4
0
        public string AddPlayer(string type, string username)
        {
            IPlayer player = new PlayerFactory().CreatePlayer(type, username);

            this.playerRepository.Add(player);

            return($"Successfully added player of type {type} with username: {username}");
        }
示例#5
0
        public ManagerController()
        {
            this.playerFactory = new PlayerFactory();
            this.CardFactory   = new CardFactory();

            this.playerRepository = new PlayerRepository();
            this.cardRepository   = new CardRepository();
        }
        public string AddPlayer(string type, string username)
        {
            PlayerFactory factory   = new PlayerFactory();
            IPlayer       newPlayer = factory.CreatePlayer(type, username);

            this.playerRepository.Add(newPlayer);

            return(string.
                   Format(ConstantMessages.
                          SuccessfullyAddedPlayer,
                          type, username));
        }