public abstract class SourceBasedFleetManager extends java.lang.Object implements FleetEventListener, EveryFrameScript
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG |
static float |
DESPAWN_MIN_DIST_LY |
static float |
DESPAWN_THRESHOLD_PAD_LY |
protected float |
destroyed |
protected java.util.List<CampaignFleetAPI> |
fleets |
protected int |
maxFleets |
protected int |
minFleets |
protected float |
respawnDelay |
protected SectorEntityToken |
source |
protected Vector2f |
sourceLocation |
protected float |
thresholdLY |
Constructor and Description |
---|
SourceBasedFleetManager(SectorEntityToken source,
float thresholdLY,
int minFleets,
int maxFleets,
float respawnDelay) |
Modifier and Type | Method and Description |
---|---|
void |
advance(float amount)
Use SectorAPI.getClock() to convert to campaign days.
|
SectorEntityToken |
getSource() |
float |
getThresholdLY() |
boolean |
isDone() |
void |
reportBattleOccurred(CampaignFleetAPI fleet,
CampaignFleetAPI primaryWinner,
BattleAPI battle)
"fleet" will be null if the listener is registered with the ListenerManager, and non-null
if the listener is added directly to a fleet.
|
void |
reportFleetDespawnedToListener(CampaignFleetAPI fleet,
CampaignEventListener.FleetDespawnReason reason,
java.lang.Object param) |
boolean |
runWhilePaused() |
void |
setDone(boolean done) |
protected abstract CampaignFleetAPI |
spawnFleet() |
public static float DESPAWN_THRESHOLD_PAD_LY
public static float DESPAWN_MIN_DIST_LY
protected java.util.List<CampaignFleetAPI> fleets
protected float thresholdLY
protected SectorEntityToken source
public static boolean DEBUG
protected int minFleets
protected int maxFleets
protected float respawnDelay
protected float destroyed
protected Vector2f sourceLocation
public SourceBasedFleetManager(SectorEntityToken source, float thresholdLY, int minFleets, int maxFleets, float respawnDelay)
public float getThresholdLY()
public SectorEntityToken getSource()
protected abstract CampaignFleetAPI spawnFleet()
public void advance(float amount)
EveryFrameScript
advance
in interface EveryFrameScript
amount
- seconds elapsed during the last frame.public boolean isDone()
isDone
in interface EveryFrameScript
public void setDone(boolean done)
public boolean runWhilePaused()
runWhilePaused
in interface EveryFrameScript
public void reportFleetDespawnedToListener(CampaignFleetAPI fleet, CampaignEventListener.FleetDespawnReason reason, java.lang.Object param)
reportFleetDespawnedToListener
in interface FleetEventListener
public void reportBattleOccurred(CampaignFleetAPI fleet, CampaignFleetAPI primaryWinner, BattleAPI battle)
FleetEventListener
reportBattleOccurred
in interface FleetEventListener
Copyright © 2013 Fractal Softworks, LLC. All Rights Reserved.