public DummyStationExchange(String name, CampaignFleetAPI source, boolean includeFlagShip) { if (name == null) name = source.getName(); dummy = createDummyStation(name); this.source = source; this.includeFlagShip = includeFlagShip; CargoSupport.setCargo(dummy.getCargo(), source, includeFlagShip); // sync cargo to dummy }
/** * remove dummy station and its containning system * * @param dummy */ private void removeDummyStation(OrbitalStationAPI dummy) { LocationAPI sys = dummy.getContainingLocation(); sys.removeEntity(dummy); }
/** * sync station's cargo and ships to fleet * * @param fleet * @param dummyStation * @param includeFlagShip * @return */ public void sync() { CargoSupport.clear(source, includeFlagShip); CargoSupport.takeAll(source, dummy.getCargo()); removeDummyStation(dummy); }