@Test public void dreadnaughtTest() { SpaceBattleSimulation sim = new SpaceBattleSimulation(); SpaceBattleSimulation.Bomber friend = sim.new Bomber(); SpaceBattleSimulation.PatrolVessel enemy = sim.new PatrolVessel(); SpaceBattleSimulation.engagement(enemy, friend); System.out.println("Dreadnaught: " + friend.isDestroyed); System.out.println("Patrol Vessel: " + enemy.isDestroyed); }
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);  }