public class WarSimScript extends java.lang.Object implements EveryFrameScript, ObjectiveEventListener
| Modifier and Type | Class and Description |
|---|---|
static class |
WarSimScript.LocationDanger |
| Modifier and Type | Field and Description |
|---|---|
static float |
CHECK_DAYS |
static float |
CHECK_PROB |
static java.lang.String |
KEY |
protected java.util.List<StarSystemAPI> |
queue |
protected TimeoutTracker<java.lang.String> |
timeouts |
| Constructor and Description |
|---|
WarSimScript() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addObjectiveActionResponse(SectorEntityToken objective,
FactionAPI faction,
FactionAPI enemy) |
void |
advance(float amount)
Use SectorAPI.getClock() to convert to campaign days.
|
protected java.lang.String |
getBuildSimTimeoutId(SectorEntityToken objective) |
protected java.lang.String |
getControlSimTimeoutId(SectorEntityToken objective) |
protected java.lang.String |
getControlTimeoutId(SectorEntityToken objective,
FactionAPI faction) |
static WarSimScript.LocationDanger |
getDangerFor(FactionAPI faction,
StarSystemAPI system) |
static WarSimScript.LocationDanger |
getDangerFor(float factionStrength,
float enemyStrength) |
static WarSimScript.LocationDanger |
getDangerFor(java.lang.String factionId,
StarSystemAPI system) |
static float |
getEnemyStrength(FactionAPI faction,
StarSystemAPI system) |
static float |
getEnemyStrength(FactionAPI faction,
StarSystemAPI system,
boolean assumeHostileToPlayer) |
static float |
getEnemyStrength(java.lang.String factionId,
StarSystemAPI system) |
static float |
getEnemyStrength(java.lang.String factionId,
StarSystemAPI system,
boolean assumeHostileToPlayer) |
static float |
getFactionStrength(FactionAPI faction,
StarSystemAPI system) |
static float |
getFactionStrength(java.lang.String factionId,
StarSystemAPI system) |
static CountingMap<FactionAPI> |
getFactionStrengths(StarSystemAPI system) |
static WarSimScript |
getInstance() |
static float |
getRelativeEnemyStrength(java.lang.String factionId,
StarSystemAPI system) |
static float |
getRelativeFactionStrength(java.lang.String factionId,
StarSystemAPI system) |
protected java.lang.String |
getStarSystemTimeoutId(StarSystemAPI system) |
static float |
getStationStrength(FactionAPI faction,
StarSystemAPI system,
SectorEntityToken from) |
TimeoutTracker<java.lang.String> |
getTimeouts() |
static boolean |
isAlreadyFightingFor(SectorEntityToken objective,
FactionAPI faction) |
boolean |
isDone() |
void |
processStarSystem(StarSystemAPI system) |
protected java.lang.Object |
readResolve() |
static void |
removeFightOrdersFor(SectorEntityToken target,
FactionAPI faction) |
static void |
removeNoFightingTimeoutForObjective(SectorEntityToken objective,
FactionAPI faction) |
void |
reportObjectiveChangedHands(SectorEntityToken objective,
FactionAPI from,
FactionAPI to) |
void |
reportObjectiveDestroyed(SectorEntityToken objective,
SectorEntityToken stableLocation,
FactionAPI enemy) |
boolean |
runWhilePaused() |
static void |
setNoFightingForObjective(SectorEntityToken objective,
FactionAPI faction,
float timeout) |
protected boolean |
wantsToOwnObjective(FactionAPI faction,
CountingMap<FactionAPI> str,
SectorEntityToken o)
If it doesn't already own it, it's owned by an enemy, and the faction either
has the closest market to it or is the strongest in-system faction.
|
public static final java.lang.String KEY
public static final float CHECK_DAYS
public static final float CHECK_PROB
protected TimeoutTracker<java.lang.String> timeouts
protected java.util.List<StarSystemAPI> queue
public WarSimScript()
public static WarSimScript getInstance()
protected java.lang.Object readResolve()
public void advance(float amount)
EveryFrameScriptadvance in interface EveryFrameScriptamount - seconds elapsed during the last frame.public void processStarSystem(StarSystemAPI system)
protected boolean wantsToOwnObjective(FactionAPI faction, CountingMap<FactionAPI> str, SectorEntityToken o)
faction - str - o - public void reportObjectiveChangedHands(SectorEntityToken objective, FactionAPI from, FactionAPI to)
reportObjectiveChangedHands in interface ObjectiveEventListenerpublic void reportObjectiveDestroyed(SectorEntityToken objective, SectorEntityToken stableLocation, FactionAPI enemy)
reportObjectiveDestroyed in interface ObjectiveEventListenerprotected java.lang.String getStarSystemTimeoutId(StarSystemAPI system)
protected java.lang.String getBuildSimTimeoutId(SectorEntityToken objective)
protected java.lang.String getControlSimTimeoutId(SectorEntityToken objective)
protected java.lang.String getControlTimeoutId(SectorEntityToken objective, FactionAPI faction)
protected void addObjectiveActionResponse(SectorEntityToken objective, FactionAPI faction, FactionAPI enemy)
public boolean isDone()
isDone in interface EveryFrameScriptpublic boolean runWhilePaused()
runWhilePaused in interface EveryFrameScriptpublic static CountingMap<FactionAPI> getFactionStrengths(StarSystemAPI system)
public static float getRelativeEnemyStrength(java.lang.String factionId, StarSystemAPI system)
public static float getRelativeFactionStrength(java.lang.String factionId, StarSystemAPI system)
public static float getEnemyStrength(java.lang.String factionId, StarSystemAPI system)
public static float getEnemyStrength(FactionAPI faction, StarSystemAPI system)
public static float getEnemyStrength(java.lang.String factionId, StarSystemAPI system, boolean assumeHostileToPlayer)
public static float getEnemyStrength(FactionAPI faction, StarSystemAPI system, boolean assumeHostileToPlayer)
public static float getFactionStrength(java.lang.String factionId, StarSystemAPI system)
public static float getFactionStrength(FactionAPI faction, StarSystemAPI system)
public static float getStationStrength(FactionAPI faction, StarSystemAPI system, SectorEntityToken from)
public TimeoutTracker<java.lang.String> getTimeouts()
public static void removeFightOrdersFor(SectorEntityToken target, FactionAPI faction)
public static void setNoFightingForObjective(SectorEntityToken objective, FactionAPI faction, float timeout)
public static void removeNoFightingTimeoutForObjective(SectorEntityToken objective, FactionAPI faction)
public static boolean isAlreadyFightingFor(SectorEntityToken objective, FactionAPI faction)
public static WarSimScript.LocationDanger getDangerFor(FactionAPI faction, StarSystemAPI system)
public static WarSimScript.LocationDanger getDangerFor(java.lang.String factionId, StarSystemAPI system)
public static WarSimScript.LocationDanger getDangerFor(float factionStrength, float enemyStrength)