1package com.fs.starfarer.api.impl.campaign.procgen;
3import java.util.ArrayList;
4import java.util.HashMap;
8import org.lwjgl.util.vector.Vector2f;
10import com.fs.starfarer.api.campaign.PlanetAPI;
11import com.fs.starfarer.api.campaign.SectorEntityToken;
12import com.fs.starfarer.api.campaign.StarSystemAPI;
13import com.fs.starfarer.api.impl.campaign.procgen.ProcgenUsedNames.NamePick;
17 public static enum ConstellationType {
22 protected transient Map<SectorEntityToken, PlanetAPI>
lagrangeParentMap =
new HashMap<SectorEntityToken, PlanetAPI>();
23 protected transient Map<SectorEntityToken, List<SectorEntityToken>>
allEntitiesAdded =
new HashMap<SectorEntityToken, List<SectorEntityToken>>();
25 protected List<StarSystemAPI>
systems =
new ArrayList<StarSystemAPI>();
26 protected ConstellationType
type = ConstellationType.NORMAL;
53 Vector2f loc =
new Vector2f();
54 if (
systems.isEmpty())
return loc;
56 for (StarSystemAPI system :
systems) {
57 Vector2f.add(loc, system.getLocation(), loc);
60 loc.scale(1f / (
float)
systems.size());
82 return namePick.nameWithRomanSuffixIfAny;
87 String constellationText =
getName() +
" Constellation";
88 if (
getType() == ConstellationType.NEBULA) {
89 constellationText =
getName() +
" Nebula";
91 return constellationText;
97 name = name.replaceAll(
"Constellation",
"constellation");
98 name = name.replaceAll(
"Nebula",
"nebula");
131 StarSystemAPI result =
null;
132 for (StarSystemAPI curr :
systems) {
133 int count = curr.getPlanets().size();
transient Map< SectorEntityToken, List< SectorEntityToken > > allEntitiesAdded
Map< SectorEntityToken, PlanetAPI > getLagrangeParentMap()
ConstellationType getType()
transient boolean leavePickedNameUnused
List< StarSystemAPI > getSystems()
void setAllEntitiesAdded(Map< SectorEntityToken, List< SectorEntityToken > > allEntitiesAdded)
Map< SectorEntityToken, List< SectorEntityToken > > getAllEntitiesAdded()
boolean isLeavePickedNameUnused()
void setNameOverride(String nameOverride)
String getNameWithLowercaseType()
Constellation(ConstellationType type, StarAge age)
List< StarSystemAPI > systems
void setLagrangeParentMap(Map< SectorEntityToken, PlanetAPI > lagrangeParentMap)
void setNamePick(NamePick namePick)
StarSystemAPI getSystemWithMostPlanets()
void setType(ConstellationType type)
void setLeavePickedNameUnused(boolean leavePickedNameUnused)
transient Map< SectorEntityToken, PlanetAPI > lagrangeParentMap