Esempio n. 1
0
 public void Determine_Collision_Exists()
 {
     var shipA = new Ship { Position = new Vector(0, 0, 0), Velocity = new Vector(10, 0, 0) };
     var shipB = new Ship { Position = new Vector(10, 10, 0), Velocity = new Vector(0, 20, 0) };
     var list = new MovementList(new List<Ship> { shipA, shipB });
     Assert.IsTrue(list.HasCollisions);
 }
        public void Ships_Are_In_New_Position()
        {
            var shipA = new Ship {Position = new Vector(0, 0, 0), Velocity = new Vector(2, 0, 0)};
            var shipB = new Ship { Position = new Vector(10, 10, 10), Velocity = new Vector(2, 0, 0) };
            var list = new MovementList(new List<Ship> {shipA, shipB});

            list.ApplyMovement();

            Assert.That(shipA.Position, Is.EqualTo(new Vector(2, 0, 0)));
            Assert.That(shipB.Position, Is.EqualTo(new Vector(12, 10, 10)));
        }
 public void SetUp()
 {
     ship = new Ship {Position = Vector.Origin};
 }
Esempio n. 4
0
 public void Add(Ship ship)
 {
     ships.Add(ship);
 }