/** * Load the given unit. * * @param unit * - the <code>Entity</code> to be loaded. * @exception - If the unit can't be loaded, an * <code>IllegalArgumentException</code> exception will be * thrown. */ @Override public void load(Entity unit) throws IllegalArgumentException { // If we can't load the unit, throw an exception. if (!canLoad(unit)) { throw new IllegalArgumentException("Can not load " + unit.getShortName() + " into this bay. " + getUnused()); } currentSpace -= spaceForUnit(unit); if((unit.game.getPhase() != IGame.Phase.PHASE_DEPLOYMENT) && (unit.game.getPhase() != IGame.Phase.PHASE_LOUNGE)) { loadedThisTurn += 1; } // Add the unit to our list of troops. troops.addElement(unit.getId()); }