Exemplo n.º 1
0
        public Team(Player[] players, ITeamStrategy strategy)
        {
            Contract.Requires<ArgumentNullException>(players != null);
            Contract.Requires<ArgumentNullException>(strategy != null);

            _players = players;
            _strategy = strategy;
        }
        public void TestPlayersCount()
        {
            var players = new Player[10];

            var team = new Team(players, null);
            var validator = new StandardTeamValidator();

            Assert.IsFalse(validator.Validate(team));
        }
        public void TestNullPlayers()
        {
            var players = new Player[11];
            for (int i = 0; i < 11; i++)
                players[i] = new Player("Player" + i);

            var team = new Team(players, null);
            var validator = new StandardTeamValidator();

            Assert.IsTrue(validator.Validate(team));
        }
Exemplo n.º 4
0
 public PlayerSpeed GetPlayerSpeed(Player player)
 {
     return _playerSpeeds[player];
 }
Exemplo n.º 5
0
 public PlayerPosition GetPlayerPosition(Player player)
 {
     return _playerPositions[player];
 }
Exemplo n.º 6
0
 public PlayerAction this[Player player]
 {
     get { return _playerActions[player]; }
 }
Exemplo n.º 7
0
 PlayerSpeed this[Player player]
 {
     get { return _speed[player]; }
 }