Extract from Kostroma.java from Dassault-Mikoyan Engineering v.1.6a :
// Abandoned orbital terminal.
SectorEntityToken derelictTerminal = system.addCustomEntity("mariegalante_station", "Orbital Terminal", "station_side03", "neutral");
derelictTerminal.setCircularOrbitWithSpin(system.getEntityById("istl_planet_mariegalante"), 210, 240, 45, 7, 21);
derelictTerminal.setInteractionImage("illustrations", "space_wreckage");
derelictTerminal.setCustomDescriptionId("station_mariegalante");
[...]
//Two small pirate stations, pirate when market perf improves.
SectorEntityToken derelictPatrol = system.addCustomEntity("patrol_station", "Patrol Station", "station_side05", "neutral");
derelictPatrol.setCircularOrbitWithSpin(system.getEntityById("kostroma"), 225, 4400, 210, 9, 27);
derelictPatrol.setInteractionImage("illustrations", "space_wreckage");
derelictPatrol.setCustomDescriptionId("station_pirate1");
SectorEntityToken derelictCustoms = system.addCustomEntity("customs_station", "Customs Port", "station_side05", "neutral");
derelictCustoms.setCircularOrbitWithSpin(system.getEntityById("kostroma"), 345, 4400, 210, 6, 18);
derelictCustoms.setInteractionImage("illustrations", "space_wreckage");
derelictCustoms.setCustomDescriptionId("station_pirate2");
Extract from boggledTools.java form Terraforming and Station Construction v8.0.2 :
public static boolean colonizableStationInSystem(SectorEntityToken playerFleet) {
Iterator allEntitiesInSystem = playerFleet.getStarSystem().getAllEntities().iterator();
while (allEntitiesInSystem.hasNext()) {
SectorEntityToken entity = (SectorEntityToken) allEntitiesInSystem.next();
if (entity.hasTag("station") && entity.getMarket() != null && entity.getMarket().hasCondition(Conditions.ABANDONED_STATION)) {
return true;
}
}
return false;
}