public class RaceMode extends java.lang.Object implements SimulationMode
n
points for winner, n-1-rank
points for others.
Modifier and Type | Class and Description |
---|---|
static class |
RaceMode.RaceModeState
timed state for
RaceMode |
SimulationMode.Placement, SimulationMode.SimulationModeDisplay
Modifier and Type | Field and Description |
---|---|
Racetrack |
racetrack
Obligatory first call to
select() to be assigned |
Constructor and Description |
---|
RaceMode() |
Modifier and Type | Method and Description |
---|---|
void |
determinePointsForRanking()
PRELIM the
SimulationMode determines the points to achieve for every participant. |
void |
drawLandscape(ArenaController arenaController,
javax.media.opengl.GL gl,
Vector drawableSize,
SimulationRun simulationRun,
int simulationStateIndex)
As
SimulationMode s have different Landscapes ,
drawing the background is their obligation. |
boolean |
evaluateMatchEnd(SimulationState currentState,
double absoluteTime,
double timeLimit,
SimulationRun sr)
evaluates if victory conditions are met for the given simulation mode
|
Vector |
getAdditiveAcceleration(Body body,
TerrainType surface)
An opportunity to add a static force, which is valid over the current frame
|
Landscape |
getLandscape()
Every simulation mode has a background.
|
SimulationMode.Placement |
getNextBodyStartPos(java.util.List<Body> bodies)
sets position and orientation for body
|
RaceMode.RaceModeState |
getSimulationModeState(SimulationModeState currentState)
sets a new state if the old one is invalid
|
void |
hookChargeEnergy(java.util.List<Body> bodies,
double elapsedTime)
leaves the energy management up to the
SimulationMode . |
void |
hookCollisionDetection(java.util.LinkedList<Collision> collisions,
java.util.List<MotionTargetPanzer> motionTargets)
This hook is called at every simulation frame.
|
void |
hookSimulationCycle(SimulationState currentState)
This hook is called at every simulation frame.
|
void |
nextCameraMode(SimulationState currentState)
Changes the camera mode
|
void |
select()
Initialization routine
|
java.lang.String |
toString() |
public void determinePointsForRanking()
SimulationMode
SimulationMode
determines the points to achieve for every participant.
TODO call at end of match
TODO implement points for rankingdeterminePointsForRanking
in interface SimulationMode
public void drawLandscape(ArenaController arenaController, javax.media.opengl.GL gl, Vector drawableSize, SimulationRun simulationRun, int simulationStateIndex)
SimulationMode
SimulationMode
s have different Landscapes
,
drawing the background is their obligation.drawLandscape
in interface SimulationMode
arenaController
- - for drawinggl
- - drawing routines need thatdrawableSize
- - size of canvassimulationRun
- - the entire run, because sometimes we need to
access more than the current state, which should be drawnsimulationStateIndex
- - index of the SimulationState within the
entire SimulationRun that should be drawn by this callpublic boolean evaluateMatchEnd(SimulationState currentState, double absoluteTime, double timeLimit, SimulationRun sr)
SimulationMode
evaluateMatchEnd
in interface SimulationMode
public Vector getAdditiveAcceleration(Body body, TerrainType surface)
SimulationMode
getAdditiveAcceleration
in interface SimulationMode
body
- - for positionsurface
- - yet unusednull
public Landscape getLandscape()
SimulationMode
getLandscape
in interface SimulationMode
public SimulationMode.Placement getNextBodyStartPos(java.util.List<Body> bodies)
SimulationMode
getNextBodyStartPos
in interface SimulationMode
SimulationMode.Placement
public RaceMode.RaceModeState getSimulationModeState(SimulationModeState currentState)
SimulationMode
getSimulationModeState
in interface SimulationMode
currentState
- null
public void hookChargeEnergy(java.util.List<Body> bodies, double elapsedTime)
SimulationMode
SimulationMode
.hookChargeEnergy
in interface SimulationMode
public void hookCollisionDetection(java.util.LinkedList<Collision> collisions, java.util.List<MotionTargetPanzer> motionTargets)
SimulationMode
SimulationMode
in the running Simulation
.hookCollisionDetection
in interface SimulationMode
collisions
- - to be filledmotionTargets
- - to be readpublic void hookSimulationCycle(SimulationState currentState)
SimulationMode
SimulationMode
in the running Simulation
.hookSimulationCycle
in interface SimulationMode
public void nextCameraMode(SimulationState currentState)
SimulationMode
nextCameraMode
in interface SimulationMode
currentState
- can be used to select the next camera mode depending
on the currently displayed simulation state.public void select()
SimulationMode
select
in interface SimulationMode
public java.lang.String toString()
toString
in class java.lang.Object