Beispiel #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);
            
        }
Beispiel #2
0
 public void removeHealthBar(HealthBar healthbar) {
     healthBars.Remove(healthbar);
 }
Beispiel #3
0
 public void addHealthBar(HealthBar healthbar) {
     healthBars.Add(healthbar);
 }
Beispiel #4
0
 public Ship(Shape shape)
 {
     this.shape = shape;
     healthBar = new HealthBar(shape.size);
 }