1package com.fs.starfarer.api;
3import java.io.IOException;
4import java.io.InputStream;
5import java.util.Collection;
11import org.json.JSONArray;
12import org.json.JSONException;
13import org.json.JSONObject;
14import org.lwjgl.util.vector.Vector2f;
16import com.fs.starfarer.api.campaign.CargoAPI;
17import com.fs.starfarer.api.campaign.CargoAPI.CargoItemType;
18import com.fs.starfarer.api.campaign.CargoStackAPI;
19import com.fs.starfarer.api.campaign.CustomEntitySpecAPI;
20import com.fs.starfarer.api.campaign.CustomUIPanelPlugin;
21import com.fs.starfarer.api.campaign.FactionAPI;
22import com.fs.starfarer.api.campaign.FactionSpecAPI;
23import com.fs.starfarer.api.campaign.LocationAPI;
24import com.fs.starfarer.api.campaign.PlanetSpecAPI;
25import com.fs.starfarer.api.campaign.SectorEntityToken;
26import com.fs.starfarer.api.campaign.SpecialItemSpecAPI;
27import com.fs.starfarer.api.campaign.econ.CommoditySpecAPI;
28import com.fs.starfarer.api.campaign.econ.MarketAPI;
29import com.fs.starfarer.api.campaign.econ.SubmarketSpecAPI;
30import com.fs.starfarer.api.characters.MarketConditionSpecAPI;
31import com.fs.starfarer.api.characters.PersonAPI;
32import com.fs.starfarer.api.characters.PersonalityAPI;
33import com.fs.starfarer.api.characters.SkillSpecAPI;
34import com.fs.starfarer.api.combat.CombatEntityAPI;
35import com.fs.starfarer.api.combat.CombatReadinessPlugin;
36import com.fs.starfarer.api.combat.ShipAIConfig;
37import com.fs.starfarer.api.combat.ShipAIPlugin;
38import com.fs.starfarer.api.combat.ShipAPI;
39import com.fs.starfarer.api.combat.ShipHullSpecAPI;
40import com.fs.starfarer.api.combat.ShipSystemSpecAPI;
41import com.fs.starfarer.api.combat.ShipVariantAPI;
42import com.fs.starfarer.api.combat.WeaponAPI.WeaponSize;
43import com.fs.starfarer.api.combat.WeaponAPI.WeaponType;
44import com.fs.starfarer.api.fleet.FleetMemberAPI;
45import com.fs.starfarer.api.fleet.FleetMemberType;
46import com.fs.starfarer.api.graphics.SpriteAPI;
47import com.fs.starfarer.api.impl.codex.CodexEntryPlugin;
48import com.fs.starfarer.api.loading.AbilitySpecAPI;
49import com.fs.starfarer.api.loading.BarEventSpec;
50import com.fs.starfarer.api.loading.Description;
51import com.fs.starfarer.api.loading.Description.Type;
52import com.fs.starfarer.api.loading.EventSpecAPI;
53import com.fs.starfarer.api.loading.FighterWingSpecAPI;
54import com.fs.starfarer.api.loading.HullModSpecAPI;
55import com.fs.starfarer.api.loading.IndustrySpecAPI;
56import com.fs.starfarer.api.loading.PersonMissionSpec;
57import com.fs.starfarer.api.loading.RoleEntryAPI;
58import com.fs.starfarer.api.loading.TerrainSpecAPI;
59import com.fs.starfarer.api.loading.WeaponSlotAPI;
60import com.fs.starfarer.api.loading.WeaponSpecAPI;
61import com.fs.starfarer.api.plugins.LevelupPlugin;
62import com.fs.starfarer.api.ui.ButtonAPI;
63import com.fs.starfarer.api.ui.ButtonAPI.UICheckboxSize;
64import com.fs.starfarer.api.ui.CustomPanelAPI;
65import com.fs.starfarer.api.ui.LabelAPI;
66import com.fs.starfarer.api.ui.TextFieldAPI;
67import com.fs.starfarer.api.ui.TooltipMakerAPI;
68import com.fs.starfarer.api.util.ListMap;
153 String
loadText(String filename)
throws IOException;
161 JSONObject
loadJSON(String filename)
throws IOException, JSONException;
173 JSONArray
loadCSV(String filename)
throws IOException, JSONException;
284 JSONObject
loadJSON(String filename, String modId)
throws IOException, JSONException;
285 JSONArray
loadCSV(String filename, String modId)
throws IOException, JSONException;
286 String
loadText(String filename, String modId)
throws IOException, JSONException;
308 Object
getSpec(Class c, String
id,
boolean nullOnNotFound);
309 void putSpec(Class c, String
id, Object spec);
420 int max,
boolean withText,
boolean withSell,
boolean withBuy);
521 String nodeId, Vector2f nodePos,
float angle,
float arc);
536 JSONObject
loadJSON(String filename,
boolean withMods)
throws IOException, JSONException;
537 JSONArray
loadCSV(String filename,
boolean withMods)
throws IOException, JSONException;
556 void writeJSONToCommon(String filename, JSONObject json,
boolean onlyIfChanged)
throws IOException, JSONException;
562 JSONObject
readJSONFromCommon(String filename,
boolean putInWriteCache)
throws IOException, JSONException;
600 Vector2f from, Vector2f to,
601 float weaponSpeed,
float burstFireDuration,
float weaponRange);
WeaponSlotAPI createWeaponSlot(String id, WeaponType weaponType, WeaponSize slotSize, String slotTypeStr, String nodeId, Vector2f nodePos, float angle, float arc)
ButtonAPI createCheckbox(String text, String font, Color checkColor, UICheckboxSize size)
int getMaxSensorRangeHyper()
Color getBrightPlayerColor()
boolean hasDesignTypeColor(String designType)
List< String > getSimOpponentsDev()
float getAngleInDegreesFast(Vector2f from, Vector2f to)
List< WeaponSpecAPI > getSystemWeaponSpecs()
void deleteTextFileFromCommon(String filename)
JSONArray getMergedSpreadsheetDataForMod(String idColumn, String path, String masterMod)
void putSpec(Class c, String id, Object spec)
JSONArray loadCSV(String filename)
int getMissionScore(String id)
List< String > getSimOpponents()
JSONArray getJSONArray(String key)
ListMap< String > getHullIdToVariantListMap()
AbilitySpecAPI getAbilitySpec(String abilityId)
FleetMemberAPI createFleetMember(FleetMemberType type, ShipVariantAPI variant)
float getSafeMovementDir(ShipAPI ship)
SpecialItemSpecAPI getSpecialItemSpec(String itemId)
float getSpeedPerBurnLevel()
int getIntFromArray(String key, int index)
List< TerrainSpecAPI > getAllTerrainSpecs()
CargoStackAPI createCargoStack(CargoItemType type, Object data, CargoAPI cargo)
Color getDarkPlayerColor()
void setEasySensorBonus(float easySensorBonus)
String getControlDescriptionForEnumName(String name)
LabelAPI createLabel(String text, String font)
SpriteAPI getSprite(String category, String key)
BarEventSpec getBarEventSpec(String id)
void loadTextureConvertBlackToAlpha(String filename)
void setBoolean(String key, Boolean value)
< T > Collection< T > getAllSpecs(Class< T > c)
int getMaxSensorRange(LocationAPI loc)
List< SubmarketSpecAPI > getAllSubmarketSpecs()
void writeTextFileToCommon(String filename, String data)
float getBaseTravelSpeed()
ModManagerAPI getModManager()
Description getDescription(String id, Type type)
boolean optBoolean(String key, boolean defaultValue)
void showCodex(String entryId)
float getTargetingRadius(Vector2f from, CombatEntityAPI target, boolean considerShield)
JSONObject loadJSON(String filename, boolean withMods)
List< String > getSpriteKeys(String category, String listId)
void loadFont(String filename)
boolean isShowDamageFloaties()
List< String > getAllVariantIds()
List< BarEventSpec > getAllBarEventSpecs()
void setAutoTurnMode(boolean autoTurnMode)
List< FactionSpecAPI > getAllFactionSpecs()
String loadText(String filename)
JSONObject getJSONObject(String key)
String getSpriteName(String category, String id)
SectorEntityToken createLocationToken(float x, float y)
float getFloatFromArray(String key, int index)
List< WeaponSpecAPI > getActuallyAllWeaponSpecs()
FactionSpecAPI getFactionSpec(String id)
void unloadTexture(String filename)
List< ShipSystemSpecAPI > getAllShipSystemSpecs()
boolean isStrafeKeyAToggle()
void setDevMode(boolean devMode)
TerrainSpecAPI getTerrainSpec(String terrainId)
ShipVariantAPI getVariant(String variantId)
boolean isCampaignSensorsOn()
void addEntryForRole(String factionId, String role, String variantId, float weight)
List< IndustrySpecAPI > getAllIndustrySpecs()
SpriteAPI getSprite(String category, String id, boolean emptySpriteOnNotFound)
float computeStringWidth(String in, String font)
void profilerPrintResultsTree()
float getUnitsPerLightYear()
int getCodeFor(String key)
MarketConditionSpecAPI getMarketConditionSpec(String conditionId)
Object getSpec(Class c, String id, boolean nullOnNotFound)
CombatReadinessPlugin getCRPlugin()
Object getInstanceOfScript(String className)
boolean isEnableShipExplosionWhiteout()
GameState getCurrentState()
SkillSpecAPI getSkillSpec(String skillId)
TextFieldAPI createTextField(String text, String font)
String getVersionString()
List< String > getSortedSkillIds()
CustomEntitySpecAPI getCustomEntitySpec(String id)
float getBaseFleetSelectionRadius()
ShipHullSpecAPI getHullSpec(String hullId)
Set< String > getIndustryDemand(String industryId)
HullModSpecAPI getHullModSpec(String modId)
Object getPlugin(String id)
boolean doesVariantExist(String variantId)
IndustrySpecAPI getIndustrySpec(String industryId)
List< WeaponSpecAPI > getAllWeaponSpecs()
JSONObject getSettingsJSON()
String loadText(String filename, String modId)
List< HullModSpecAPI > getAllHullModSpecs()
void showCodex(FleetMemberAPI member)
String getString(String category, String id)
JSONObject loadJSON(String filename)
JSONObject getMergedJSON(String path)
InputStream openStream(String filename)
void addCommodityInfoToTooltip(TooltipMakerAPI tooltip, float initPad, CommoditySpecAPI spec, int max, boolean withText, boolean withSell, boolean withBuy)
float getSensorRangeMaxHyper()
int computeNumFighterBays(ShipVariantAPI variant)
JSONArray loadCSV(String filename, boolean withMods)
String getControlStringForAbilitySlot(int index)
Object getNewPluginInstance(String id)
boolean getBoolean(String key)
List< String > getSpriteKeys(String category)
EventSpecAPI getEventSpec(String eventId)
float getBonusXP(String key)
float getScreenWidthPixels()
Color getBasePlayerColor()
ShipVariantAPI createEmptyVariant(String hullVariantId, ShipHullSpecAPI hullSpec)
CommoditySpecAPI getCommoditySpec(String commodityId)
List< String > getSortedAbilityIds()
JSONObject loadJSON(String filename, String modId)
ShipAIPlugin pickShipAIPlugin(FleetMemberAPI member, ShipAPI ship)
ShipAIPlugin createDefaultShipAI(ShipAPI ship, ShipAIConfig config)
float getFleetSelectionRadiusPerUnitSize()
JSONArray getMergedSpreadsheetData(String idColumn, String path)
void setFloat(String key, Float value)
String getNextGreekLetter(Object context)
boolean fileExistsInCommon(String filename)
void showCodex(CodexEntryPlugin tempEntry)
CustomPanelAPI createCustom(float width, float height, CustomUIPanelPlugin plugin)
boolean isGeneratingNewGame()
void removeEntryForRole(String factionId, String role, String variantId)
int getShippingCapacity(MarketAPI market, boolean inFaction)
ClassLoader getScriptClassLoader()
void profilerSetEnabled(boolean enabled)
float getFloat(String key)
FighterWingSpecAPI getFighterWingSpec(String wingId)
float getMaxArmorDamageReduction()
FleetMemberAPI createFleetMember(FleetMemberType type, String variantOrWingId)
List< SpecialItemSpecAPI > getAllSpecialItemSpecs()
List< PlanetSpecAPI > getAllPlanetSpecs()
void setEnableShipExplosionWhiteout(boolean enableShipExplosionWhiteout)
JSONObject getMergedJSONForMod(String path, String masterMod)
void forceMipmapsFor(String filename, boolean forceMipmaps)
void writeJSONToCommon(String filename, JSONObject json, boolean onlyIfChanged)
float getMinArmorFraction()
List< CommoditySpecAPI > getAllCommoditySpecs()
WeaponSpecAPI getWeaponSpec(String weaponId)
JSONArray loadCSV(String filename, String modId)
ShipSystemSpecAPI getShipSystemSpec(String id)
List< RoleEntryAPI > getDefaultEntriesForRole(String role)
List< ShipHullSpecAPI > getAllShipHullSpecs()
SpriteAPI getSprite(String filename)
float getFriendlyFireDanger(ShipAPI shooter, CombatEntityAPI target, Vector2f from, Vector2f to, float weaponSpeed, float burstFireDuration, float weaponRange)
float getSensorRangeMax()
void addDefaultEntryForRole(String role, String variantId, float weight)
FactionAPI createBaseFaction(String factionId)
String getString(String key)
Set< String > getIndustrySupply(String industryId)
float getScreenHeightPixels()
PersonalityAPI getPersonaltySpec(String id)
String readTextFileFromCommon(String filename)
ButtonAPI createCheckbox(String text, UICheckboxSize size)
PersonMissionSpec getMissionSpec(String id)
boolean isInCampaignState()
List< RoleEntryAPI > getEntriesForRole(String factionId, String role)
String getNextCoolGreekLetter(Object context)
List< String > getSkillIds()
float getMaxFleetSelectionRadius()
List< MarketConditionSpecAPI > getAllMarketConditionSpecs()
void loadTexture(String filename)
String getControlStringForEnumName(String name)
JSONObject readJSONFromCommon(String filename, boolean putInWriteCache)
List< String > getAptitudeIds()
void showCodex(List< CodexEntryPlugin > tempEntries)
void profilerBegin(String id)
List< PersonMissionSpec > getAllMissionSpecs()
List< FighterWingSpecAPI > getAllFighterWingSpecs()
float getAngleInDegreesFast(Vector2f v)
Color getColor(String id)
void removeDefaultEntryForRole(String role, String variantId)
SpriteAPI getSprite(SpriteId id)
LevelupPlugin getLevelupPlugin()
float getScreenScaleMult()
Color getDesignTypeColor(String designType)