@Test public void bomberAttacksCruiser(){ SpaceBattleSimulation sim = new SpaceBattleSimulation(); Bomber bomber = sim.new Bomber(); Cruiser cruiser = sim.new Cruiser(); int startingHealth = cruiser.getHp(); SpaceBattleSimulation.engagement(bomber, cruiser); int endingHealth = cruiser.getHp(); Assert.assertEquals(300000, (startingHealth - endingHealth)); }
public static void engagement(Ship enemy, Ship friend){ while(!enemy.isDestroyed && friend.isDestroyed == false){ int friendAtkVal = friend.attack((Class<Ship>) enemy.getClass()); enemy.attacked(friendAtkVal); int enemyAttackVal = enemy.attack((Class<Ship>) friend.getClass()); friend.attacked(enemyAttackVal); } }
SpaceBattleSimulation { public static void engagement(Ship enemy, Ship friend){ while(!enemy.isDestroyed && friend.isDestroyed == false){ int friendAtkVal = friend.attack((Class<Ship>) enemy.getClass()); enemy.attacked(friendAtkVal); int enemyAttackVal = enemy.attack((Class<Ship>) friend.getClass()); friend.attacked(enemyAttackVal); } } }
SpaceBattleSimulation { public static void engagement(Ship enemy, Ship friend){ while(!enemy.isDestroyed && friend.isDestroyed == false){ int friendAtkVal = friend.attack((Class<Ship>) enemy.getClass()); enemy.attacked(friendAtkVal); int enemyAttackVal = enemy.attack((Class<Ship>) friend.getClass()); friend.attacked(enemyAttackVal); } }  }
SpaceBattleSimulation { public static void engagement(Ship enemy, Ship friend){ while(!enemy.isDestroyed && friend.isDestroyed == false){ int friendAtkVal = friend.attack((Class<Ship>) enemy.getClass()); enemy.attacked(friendAtkVal); int enemyAttackVal = enemy.attack((Class<Ship>) friend.getClass()); friend.attacked(enemyAttackVal); } }  static void main(String[] args); static void engagement(Ship enemy, Ship friend); }
SpaceBattleSimulation { public static void engagement(Ship enemy, Ship friend){ while(!enemy.isDestroyed && friend.isDestroyed == false){ int friendAtkVal = friend.attack((Class<Ship>) enemy.getClass()); enemy.attacked(friendAtkVal); int enemyAttackVal = enemy.attack((Class<Ship>) friend.getClass()); friend.attacked(enemyAttackVal); } }  static void main(String[] args); static void engagement(Ship enemy, Ship friend);  }