Example #1
0
        public void decreaseTest()
        {
            int shipSize = 10;
            HealthBar target = new HealthBar(shipSize);
            target.decrease();
            target.decrease();
            Assert.AreEqual(80, target.currentHealth);

            target = new HealthBar(4);
            target.decrease();
            target.decrease();
            target.decrease();
            Assert.AreEqual(25, target.currentHealth);
            
        }
Example #2
0
 public void removeHealthBar(HealthBar healthbar) {
     healthBars.Remove(healthbar);
 }
Example #3
0
 public void addHealthBar(HealthBar healthbar) {
     healthBars.Add(healthbar);
 }
Example #4
0
 public Ship(Shape shape)
 {
     this.shape = shape;
     healthBar = new HealthBar(shape.size);
 }