Skip to content

Commit

Permalink
update isPlanetary and isFleetCarrier to allow for null values
Browse files Browse the repository at this point in the history
simplify requiresOdyssey boolean
  • Loading branch information
Daniel-J-Mason committed Jul 7, 2024
1 parent d2f60a1 commit bafbdec
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,16 @@ public void receive(CommodityMessage.V3 message) {
String[] prohibitedCommodities = payload.prohibited();

var planetaryStationTypes = List.of("CraterOutpost", "CraterPort", "OnFootSettlement");
boolean isPlanetary = payload.stationType() != null && planetaryStationTypes.contains(payload.stationType());
boolean isFleetCarrier = "FleetCarrier".equals(payload.stationType());
boolean requiresOdyssey = Boolean.TRUE.equals(payload.odyssey());
Boolean isPlanetary;
Boolean isFleetCarrier;
if (payload.stationType() != null) {
isPlanetary = planetaryStationTypes.contains(payload.stationType());
isFleetCarrier = "FleetCarrier".equals(payload.stationType());
} else {
isFleetCarrier = null;
isPlanetary = null;
}
boolean requiresOdyssey = payload.odyssey();

CompletableFuture<Station> stationCompletableFuture = CompletableFuture.supplyAsync(() -> createOrLoadSystemPort.createOrLoad(new System(
idGenerator.generateId(),
Expand Down

0 comments on commit bafbdec

Please sign in to comment.