/** * @return only entities in that can be combat dropped */ public Vector<Entity> getDroppableUnits() { 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 Bay) && (((Bay) next).getCurrentDoors() > 0)) { Bay nextbay = (Bay) next; for (Entity e : nextbay.getDroppableUnits()) { result.addElement(e); } } } // Return the list. return result; }
currentBay = Bays.elementAt(i); Vector<Integer> bayChoices = new Vector<Integer>(); currentUnits = currentBay.getDroppableUnits().stream() .filter(e -> !alreadyDropped.contains(e.getId())) .collect(Collectors.toList());