Starsector API
Loading...
Searching...
No Matches
LocationAPI.java
Go to the documentation of this file.
1package com.fs.starfarer.api.campaign;
2
3import java.util.Collection;
4import java.util.List;
5import java.util.Map;
6
7import java.awt.Color;
8
9import org.lwjgl.util.vector.Vector2f;
10
11import com.fs.starfarer.api.EveryFrameScript;
12import com.fs.starfarer.api.campaign.rules.MemoryAPI;
13import com.fs.starfarer.api.impl.campaign.procgen.Constellation;
14import com.fs.starfarer.api.util.ColorShifterAPI;
15
21public interface LocationAPI {
22
23 String getId();
24
30 boolean activeThisFrame();
31
33 void setBackgroundTextureFilename(String backgroundTextureFilename);
34
37 List<SpawnPointPlugin> getSpawnPoints();
38
39 void spawnFleet(SectorEntityToken anchor, float xOffset, float yOffset, CampaignFleetAPI fleet);
40
47 SectorEntityToken createToken(float x, float y);
48
50
51
54
55
56 PlanetAPI addPlanet(String id, SectorEntityToken focus, String name, String type,
57 float angle, float radius, float orbitRadius, float orbitDays);
58 SectorEntityToken addAsteroidBelt(SectorEntityToken focus, int numAsteroids, float orbitRadius, float width, float minOrbitDays, float maxOrbitDays);
59
61 float orbitRadius, float width, float minOrbitDays,
62 float maxOrbitDays, String terrainId, String optionalName);
63
64 void addOrbitalJunk(SectorEntityToken focus, String junkType, int num,
65 float minSize, float maxSize, float orbitRadius, float width,
66 float minOrbitDays, float maxOrbitDays, float minSpin, float maxSpin);
67
68
84 RingBandAPI addRingBand(SectorEntityToken focus, String category, String key,
85 float bandWidthInTexture, int bandIndex, Color color,
86 float bandWidthInEngine, float middleRadius, float orbitDays);
87
88
110 String key, float bandWidthInTexture, int bandIndex, Color color,
111 float bandWidthInEngine, float middleRadius, float orbitDays,
112 String terrainId, String optionalName);
113
114
115// /**
116// * Add station with custom graphic and radius.
117// * @param id
118// * @param focus
119// * @param category key in graphics section in settings.jsno
120// * @param key in category
121// * @param radius radius. Sprite will be sized to (radius * 2, radius * 2)
122// * @param angle
123// * @param orbitRadius
124// * @param orbitDays
125// * @param name
126// * @param factionId
127// * @return
128// */
129// SectorEntityToken addOrbitalStation(String id, SectorEntityToken focus,
130// String category, String key, float radius,
131// float angle, float orbitRadius, float orbitDays,
132// String name, String factionId);
133// SectorEntityToken addOrbitalStation(String id, SectorEntityToken focus,
134// float angle, float orbitRadius, float orbitDays,
135// String name, String factionId);
136
137
147 public CustomCampaignEntityAPI addCustomEntity(String id, String name, String type,
148 String factionId);
149
163 public CustomCampaignEntityAPI addCustomEntity(String id, String name, String type,
164 String factionId, float radius, float spriteWidth, float spriteHeight);
165
166
167 public SectorEntityToken addTerrain(String terrainId, Object param);
168
179 List getEntities(Class implementedClassOrInterface);
180
181 List<SectorEntityToken> getEntitiesWithTag(String tag);
182
183 List<CampaignFleetAPI> getFleets();
184 List<PlanetAPI> getPlanets();
185
192 @Deprecated List<SectorEntityToken> getOrbitalStations();
193 List<SectorEntityToken> getAsteroids();
194
200 @Deprecated
203 Vector2f getLocation();
204
205 boolean isHyperspace();
206
213 void removeScriptsOfClass(Class c);
215
216 String getName();
217 void setName(String name);
218
219 List<SectorEntityToken> getAllEntities();
220
221
222 SectorEntityToken addCorona(SectorEntityToken star, float extraRadius, float windBurnLevel, float flareProbability, float crLossMult);
223 SectorEntityToken addCorona(SectorEntityToken star, String terrainType, float extraRadius, float windBurnLevel, float flareProbability, float crLossMult);
224 List<CampaignTerrainAPI> getTerrainCopy();
225
226 Map<String, Object> getPersistentData();
227
229
230 void setBackgroundOffset(float x, float y);
231
233
235
236 boolean isNebula();
237
239
240 List<FleetStubAPI> getFleetStubs();
243
245
247
249
250 Collection<String> getTags();
251 boolean hasTag(String tag);
252 void addTag(String tag);
253 void removeTag(String tag);
254 void clearTags();
255
257 String type, String factionId, float radius, float spriteWidth,
258 float spriteHeight, Object pluginParams);
259
261 String type, String factionId, Object pluginParams);
262
263 List<SectorEntityToken> getJumpPoints();
264
266
268
269
277 List<CustomCampaignEntityAPI> getCustomEntitiesWithTag(String tag);
278
279 List<EveryFrameScript> getScripts();
280
281 void addHitParticle(Vector2f loc, Vector2f vel, float size, float brightness, float duration, Color color);
282
284
286
287 ParticleControllerAPI addParticle(Vector2f loc, Vector2f vel, float size, float brightness, float rampUp, float duration, Color color);
288
290
292
294
296
297 List<NascentGravityWellAPI> getGravityWells();
298
299 List<CustomCampaignEntityAPI> getCustomEntities();
300
302
304
305 boolean isDeepSpace();
306
307}
308
309
310
311
312
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()