Exemplo n.º 1
0
        public void Test_Initializing_Of_Player_With_Same_Position()
        {
            var creat = _factory.CreatePlayerCreature("Jens", new Position(5, 5));

            _world.WorldPlayGround[creat.Position.X, creat.Position.Y].Creature = creat;

            Assert.Throws <PositionAlreadyOccupiedException>(() =>
            {
                creat = _factory.CreatePlayerCreature("Jens", new Position(5, 5));
                _world.WorldPlayGround[creat.Position.X, creat.Position.Y].Creature = creat;
            });
        }
Exemplo n.º 2
0
 public void SetUpPlayer(string name, Position?position)
 {
     Player = CreatureFactory.CreatePlayerCreature(name, position);
     Player.AttackItems.AddAttackItem(ItemFactory.CreateAttackItem("sword", "Sting", 50, 1));
     Player.DefencesItems.AddDefenceItem(ItemFactory.CreateDefenceItem("armour", "Mithril Coat", 45));
     Player.DefencesItems.AddDefenceItem(ItemFactory.CreateDefenceItem("boots", "Hairy Hobbit Feet", 5));
     Player.DefencesItems.AddDefenceItem(ItemFactory.CreateDefenceItem("helmet", "Helmet of Gloin", 15));
     World.WorldPlayGround[Player.Position.X, Player.Position.Y].Creature = Player;
 }
Exemplo n.º 3
0
 public void SetUpPlayer(string name, Position?position)
 {
     Player = CreatureFactory.CreatePlayerCreature(name, position);
     Player.AttackItems.AddAttackItem(ItemFactory.CreateAttackItem("bow", "Bow of the Galadhrim", 25, RangeEnum.Long));
     Player.AttackItems.AddAttackItem(ItemFactory.CreateAttackItem("sword", "Dual long knives", 50, RangeEnum.Short));
     Player.DefenceItems.AddDefenceItem(ItemFactory.CreateDefenceItem("armour", "Leather coat", 25));
     Player.DefenceItems.AddDefenceItem(ItemFactory.CreateDefenceItem("boots", "Leather boots", 15));
     World.WorldPlayGround[Player.Position.X, Player.Position.Y].Creature = Player;
 }
Exemplo n.º 4
0
 public CreatureAttackTests()
 {
     _logger     = new JsonTraceListener();
     _world      = new World(5, 5);
     _crtFactory = new CreatureFactory(_world, _logger);
     _itmFactory = new ItemFactory();
     _enemy      = _crtFactory.CreateEnemyCreature("boss", new Position(1, 1)) as EnemyCreature;
     _player     = _crtFactory.CreatePlayerCreature("Bilbo", new Position(2, 1)) as PlayerCreature;
     _world.WorldPlayGround[_enemy.Position.X, _enemy.Position.Y].Creature   = _enemy;
     _world.WorldPlayGround[_player.Position.X, _player.Position.Y].Creature = _player;
     _player.AttackItems.AddAttackItem(new Sword(40, "Sting"));
     _player.AttackItems.AddAttackItem(new Sword(40, "Sting"));
 }