Starsector API
Loading...
Searching...
No Matches
LocationAPI.java
Go to the documentation of this file.
1package com.fs.starfarer.api.campaign;
2
3import java.awt.Color;
4import java.util.Collection;
5import java.util.List;
6import java.util.Map;
7
8import org.lwjgl.util.vector.Vector2f;
9
10import com.fs.starfarer.api.EveryFrameScript;
11import com.fs.starfarer.api.campaign.rules.MemoryAPI;
12import com.fs.starfarer.api.impl.campaign.procgen.Constellation;
13import com.fs.starfarer.api.util.ColorShifterAPI;
14
20public interface LocationAPI {
21
22 String getId();
23
29 boolean activeThisFrame();
30
32 void setBackgroundTextureFilename(String backgroundTextureFilename);
33
36 List<SpawnPointPlugin> getSpawnPoints();
37
38 void spawnFleet(SectorEntityToken anchor, float xOffset, float yOffset, CampaignFleetAPI fleet);
39
46 SectorEntityToken createToken(float x, float y);
47
49
50
53
54
55 PlanetAPI addPlanet(String id, SectorEntityToken focus, String name, String type,
56 float angle, float radius, float orbitRadius, float orbitDays);
57 SectorEntityToken addAsteroidBelt(SectorEntityToken focus, int numAsteroids, float orbitRadius, float width, float minOrbitDays, float maxOrbitDays);
58
60 float orbitRadius, float width, float minOrbitDays,
61 float maxOrbitDays, String terrainId, String optionalName);
62
63 void addOrbitalJunk(SectorEntityToken focus, String junkType, int num,
64 float minSize, float maxSize, float orbitRadius, float width,
65 float minOrbitDays, float maxOrbitDays, float minSpin, float maxSpin);
66
67
83 RingBandAPI addRingBand(SectorEntityToken focus, String category, String key,
84 float bandWidthInTexture, int bandIndex, Color color,
85 float bandWidthInEngine, float middleRadius, float orbitDays);
86
87
109 String key, float bandWidthInTexture, int bandIndex, Color color,
110 float bandWidthInEngine, float middleRadius, float orbitDays,
111 String terrainId, String optionalName);
112
113
114// /**
115// * Add station with custom graphic and radius.
116// * @param id
117// * @param focus
118// * @param category key in graphics section in settings.jsno
119// * @param key in category
120// * @param radius radius. Sprite will be sized to (radius * 2, radius * 2)
121// * @param angle
122// * @param orbitRadius
123// * @param orbitDays
124// * @param name
125// * @param factionId
126// * @return
127// */
128// SectorEntityToken addOrbitalStation(String id, SectorEntityToken focus,
129// String category, String key, float radius,
130// float angle, float orbitRadius, float orbitDays,
131// String name, String factionId);
132// SectorEntityToken addOrbitalStation(String id, SectorEntityToken focus,
133// float angle, float orbitRadius, float orbitDays,
134// String name, String factionId);
135
136
146 public CustomCampaignEntityAPI addCustomEntity(String id, String name, String type,
147 String factionId);
148
162 public CustomCampaignEntityAPI addCustomEntity(String id, String name, String type,
163 String factionId, float radius, float spriteWidth, float spriteHeight);
164
165
166 public SectorEntityToken addTerrain(String terrainId, Object param);
167
178 List getEntities(Class implementedClassOrInterface);
179
180 List<SectorEntityToken> getEntitiesWithTag(String tag);
181
182 List<CampaignFleetAPI> getFleets();
183 List<PlanetAPI> getPlanets();
184
191 @Deprecated List<SectorEntityToken> getOrbitalStations();
192 List<SectorEntityToken> getAsteroids();
193
199 @Deprecated
202 Vector2f getLocation();
203
204 boolean isHyperspace();
205
212 void removeScriptsOfClass(Class c);
214
215 String getName();
216 void setName(String name);
217
218 List<SectorEntityToken> getAllEntities();
219
220
221 SectorEntityToken addCorona(SectorEntityToken star, float extraRadius, float windBurnLevel, float flareProbability, float crLossMult);
222 SectorEntityToken addCorona(SectorEntityToken star, String terrainType, float extraRadius, float windBurnLevel, float flareProbability, float crLossMult);
223 List<CampaignTerrainAPI> getTerrainCopy();
224
225 Map<String, Object> getPersistentData();
226
228
229 void setBackgroundOffset(float x, float y);
230
232
234
235 boolean isNebula();
236
238
239 List<FleetStubAPI> getFleetStubs();
242
243 Constellation getConstellation();
244
246
248
249 Collection<String> getTags();
250 boolean hasTag(String tag);
251 void addTag(String tag);
252 void removeTag(String tag);
253 void clearTags();
254
256 String type, String factionId, float radius, float spriteWidth,
257 float spriteHeight, Object pluginParams);
258
260 String type, String factionId, Object pluginParams);
261
262 List<SectorEntityToken> getJumpPoints();
263
265
267
268
276 List<CustomCampaignEntityAPI> getCustomEntitiesWithTag(String tag);
277
278 List<EveryFrameScript> getScripts();
279
280 void addHitParticle(Vector2f loc, Vector2f vel, float size, float brightness, float duration, Color color);
281
283
285
286 ParticleControllerAPI addParticle(Vector2f loc, Vector2f vel, float size, float brightness, float rampUp, float duration, Color color);
287
289
291
293
295
296 List<NascentGravityWellAPI> getGravityWells();
297
298 List<CustomCampaignEntityAPI> getCustomEntities();
299
300 ColorShifterAPI getBackgroundColorShifter();
301
303
304 boolean isDeepSpace();
305
306}
307
308
309
310
311
SectorEntityToken addRingBand(SectorEntityToken focus, String category, String key, float bandWidthInTexture, int bandIndex, Color color, float bandWidthInEngine, float middleRadius, float orbitDays, String terrainId, String optionalName)
RingBandAPI addRingBand(SectorEntityToken focus, String category, String key, float bandWidthInTexture, int bandIndex, Color color, float bandWidthInEngine, float middleRadius, float orbitDays)
List< CustomCampaignEntityAPI > getCustomEntities()
List< SectorEntityToken > getAllEntities()
SectorEntityToken getEntityById(String id)
SectorEntityToken addAsteroidBelt(SectorEntityToken focus, int numAsteroids, float orbitRadius, float width, float minOrbitDays, float maxOrbitDays, String terrainId, String optionalName)
SectorEntityToken addTerrain(String terrainId, Object param)
void addFleetStub(FleetStubAPI stub)
PlanetAPI addPlanet(String id, SectorEntityToken focus, String name, String type, float angle, float radius, float orbitRadius, float orbitDays)
List getEntities(Class implementedClassOrInterface)
List< SectorEntityToken > getOrbitalStations()
CustomCampaignEntityAPI addCustomEntity(String id, String name, String type, String factionId, float radius, float spriteWidth, float spriteHeight, Object pluginParams)
ParticleControllerAPI addParticle(Vector2f loc, Vector2f vel, float size, float brightness, float rampUp, float duration, Color color)
SectorEntityToken getEntityByName(String name)
void addHitParticle(Vector2f loc, Vector2f vel, float size, float brightness, float duration, Color color)
SectorEntityToken addRadioChatter(SectorEntityToken entity, float extraRadius)
List< SectorEntityToken > getJumpPoints()
List< SectorEntityToken > getEntitiesWithTag(String tag)
SectorEntityToken addCorona(SectorEntityToken star, String terrainType, float extraRadius, float windBurnLevel, float flareProbability, float crLossMult)
void addOrbitalJunk(SectorEntityToken focus, String junkType, int num, float minSize, float maxSize, float orbitRadius, float width, float minOrbitDays, float maxOrbitDays, float minSpin, float maxSpin)
SectorEntityToken addCorona(SectorEntityToken star, float extraRadius, float windBurnLevel, float flareProbability, float crLossMult)
Map< String, Object > getPersistentData()
void renderingLayersUpdated(SectorEntityToken entity)
void addScript(EveryFrameScript script)
List< CustomCampaignEntityAPI > getCustomEntitiesWithTag(String tag)
void spawnFleet(SectorEntityToken anchor, float xOffset, float yOffset, CampaignFleetAPI fleet)
AsteroidAPI addAsteroid(float radius)
void removeFleetStub(FleetStubAPI stub)
List< CampaignTerrainAPI > getTerrainCopy()
void addEntity(SectorEntityToken entity)
ColorShifterAPI getBackgroundParticleColorShifter()
SectorEntityToken createToken(float x, float y)
List< SectorEntityToken > getAsteroids()
CustomCampaignEntityAPI addCustomEntity(String id, String name, String type, String factionId, float radius, float spriteWidth, float spriteHeight)
void removeScript(EveryFrameScript script)
CustomCampaignEntityAPI addCustomEntity(String id, String name, String type, String factionId, Object pluginParams)
CustomCampaignEntityAPI addCustomEntity(String id, String name, String type, String factionId)
void setBackgroundTextureFilename(String backgroundTextureFilename)
void removeEntity(SectorEntityToken entity)
SectorEntityToken addAsteroidBelt(SectorEntityToken focus, int numAsteroids, float orbitRadius, float width, float minOrbitDays, float maxOrbitDays)
List< EveryFrameScript > getScripts()
List< NascentGravityWellAPI > getGravityWells()
void setBackgroundOffset(float x, float y)
void addSpawnPoint(SpawnPointPlugin point)
SectorEntityToken createToken(Vector2f loc)
List< CampaignFleetAPI > getFleets()
void removeSpawnPoint(SpawnPointPlugin point)
List< SpawnPointPlugin > getSpawnPoints()