/** * @return the launch rate for fighters */ public int getFighterLaunchRate() { int result = 0; // Walk through this entity's transport components; for (Transporter next : transports) { if (next instanceof ASFBay) { result += 2 * ((ASFBay) next).getCurrentDoors(); } } // Return the number. return result; }
@Override public void destroyDoor() { if (getCurrentDoors() > 0) { setCurrentDoors(getCurrentDoors() - 1); } // get rid of two empty recovery slots // it doesn't matter which ones if (recoverySlots.size() > 0) { recoverySlots.remove(0); } if (recoverySlots.size() > 0) { recoverySlots.remove(0); } }
/** * @return only entities in ASF Bays */ public Vector<Entity> getLoadedFighters() { Vector<Entity> result = new Vector<Entity>(); // Walk through this entity's transport components; // add all of their lists to ours. // I should only add entities in bays that are functional for (Transporter next : transports) { if ((next instanceof ASFBay) && (((ASFBay) next).getCurrentDoors() > 0)) { for (Entity e : next.getLoadedUnits()) { result.addElement(e); } } } // Return the list. return result; }
/** * @return only entities in ASF Bays that can be launched (i.e. not in * recovery) */ public Vector<Entity> getLaunchableFighters() { Vector<Entity> result = new Vector<Entity>(); // Walk through this entity's transport components; // add all of their lists to ours. // I should only add entities in bays that are functional for (Transporter next : transports) { if ((next instanceof ASFBay) && (((ASFBay) next).getCurrentDoors() > 0)) { Bay nextbay = (Bay) next; for (Entity e : nextbay.getLaunchableUnits()) { result.addElement(e); } } } // Return the list. return result; }