public class SimulationState
extends java.lang.Object
implements java.io.Serializable
SimulationState
can be extracted
from the SimulationRun
.Modifier and Type | Field and Description |
---|---|
double |
timestamp |
Modifier and Type | Method and Description |
---|---|
SimulationModeState |
assignSimulationModeState(SimulationMode simulationMode)
assigns the timed scenario state
|
void |
createNewBody(java.lang.Class<? extends Pilot> pilotClass,
SimulationMode simulationMode)
Creates a new
Panzer with a new instance of the supplied
Pilot . |
Body |
createNewBody(java.lang.Class<? extends Pilot> pilotClass,
Vector pos,
Angle orientation)
Creates a new
Panzer with a new instance of the supplied
Pilot , but with no random starting location |
SimulationState |
deepCopy() |
static <T extends java.io.Serializable> |
deepCopy(T copyObject)
Makes a deep copy of an arbitrary object.
|
java.util.SortedMap<java.lang.Double,Particle> |
getExplosionParticles()
This method returns a collection of all explosion particles that are
visible at the time indicated by
timestamp . |
java.util.SortedMap<java.lang.Double,Explosion> |
getExplosions()
This method returns a collection of all explosions that are visible at
the time indicated by
timestamp . |
java.util.List<Droppable> |
getMines() |
java.util.List<java.lang.String> |
getOverlayText()
Each
SimulationState offers some textual information about the current state. |
Body |
getPanzerByID(int ID)
searches all active Panzers for one with given ID.
|
java.util.List<Body> |
getPanzers() |
java.util.List<Launchable> |
getProjectiles() |
java.util.SortedMap<java.lang.Double,ScanFan> |
getScanFans()
This method returns a collection of all scanfans that are visible at the
time indicated by
timestamp . |
java.util.SortedMap<java.lang.Double,Particle> |
getSmokeParticles()
This method returns a collection of all smoke particles that are visible
at the time indicated by
timestamp . |
java.util.SortedMap<java.lang.Double,SonarTrace> |
getSonarTraces()
This method returns a collection of all sonar traces that are visible at the
time indicated by
timestamp . |
java.util.SortedMap<java.lang.Double,Body> |
getWastedump()
This method returns all destroyed panzers that are visible at
the time indicated by
timestamp . |
void |
removeAllPilots()
Removes all bodies from this frame.
|
void |
removePilots(java.lang.Class<? extends AbstractPilot> pilotClass)
Removes all panzers with pilots of a certain class from this frame.
|
public SimulationModeState assignSimulationModeState(SimulationMode simulationMode)
simulationMode
- - current SimulationMode
null
public void createNewBody(java.lang.Class<? extends Pilot> pilotClass, SimulationMode simulationMode) throws java.lang.InstantiationException, java.lang.IllegalAccessException
Panzer
with a new instance of the supplied
Pilot
.pilotClass
- simulationMode
- handles placementjava.lang.InstantiationException
java.lang.IllegalAccessException
public Body createNewBody(java.lang.Class<? extends Pilot> pilotClass, Vector pos, Angle orientation) throws java.lang.InstantiationException, java.lang.IllegalAccessException
Panzer
with a new instance of the supplied
Pilot
, but with no random starting locationpilotClass
- Body
java.lang.InstantiationException
java.lang.IllegalAccessException
public SimulationState deepCopy()
simulationRun
is not copied)public static <T extends java.io.Serializable> T deepCopy(T copyObject)
T
- copyObject
- public java.util.SortedMap<java.lang.Double,Particle> getExplosionParticles()
timestamp
.Collection
of all visible explosion particles.public java.util.SortedMap<java.lang.Double,Explosion> getExplosions()
timestamp
.Collection
of all visible Explosion
s.public java.util.List<Droppable> getMines()
List
of all active Mine
s.public java.util.List<java.lang.String> getOverlayText()
SimulationState
offers some textual information about the current state.public Body getPanzerByID(int ID)
As Panzers are serialized at every simulation step, keeping references of them is strictly disallowed, if the referee is part of the simulation (like Projectiles, Mines and Explosions). This is the way to access a Panzer.
public java.util.List<Body> getPanzers()
List
of all active Panzer
s.public java.util.List<Launchable> getProjectiles()
List
of all active Projectile
s.public java.util.SortedMap<java.lang.Double,ScanFan> getScanFans()
timestamp
.Collection
of all visible ScanFan
s.public java.util.SortedMap<java.lang.Double,Particle> getSmokeParticles()
timestamp
.Collection
of all visible smoke particles.public java.util.SortedMap<java.lang.Double,SonarTrace> getSonarTraces()
timestamp
.Collection
of all visible SonarTrace
s.public java.util.SortedMap<java.lang.Double,Body> getWastedump()
timestamp
.Panzer
s.public void removeAllPilots()
public void removePilots(java.lang.Class<? extends AbstractPilot> pilotClass)
pilotClass
-