#include <SimEngine.hpp>
Public Member Functions | |
SimEngine () | |
Constructor. | |
~SimEngine () | |
Destructor. | |
const char * | level () |
const char * | nextLevel () |
void | cleanup () |
Cleanup the simulation engine. | |
void | initGame () |
Initialise engine for a new game. | |
void | cleanupGame () |
Reset game. | |
void | setLevel (const char *name) |
bool | step (long when) |
Performs simulation step and calls listeners. | |
void | go () |
Game loop. | |
void | resetAll () |
Reset the engine. | |
void | resetTimer () |
Reset step counter. | |
void | setMultiplePerformsPerStepEnabled (bool state) |
Set or reset the multiple perform() flag. | |
long | when () |
Get the adjusted game clock. | |
bool | isGameOver () |
Returns value of game over flag. | |
void | setGameOver (bool state) |
Set the game over flag. | |
Static Public Member Functions | |
bool | init () |
Initialise the simulation engine. | |
Protected Member Functions | |
void | perform (long when) |
Performs AI actions. |
You call the SimSchema::simEngine->step() method to step the simulation engine.
Definition at line 41 of file SimEngine.hpp.
|
Constructor.
Definition at line 49 of file SimEngine.cpp. References LogDetail. |
|
Destructor.
Definition at line 58 of file SimEngine.cpp. References LogDetail. |
|
Cleanup the simulation engine. This should be called once, before application shuts down. It will cast an InitListener::cleanupEngineEvent() to registered listeners. Definition at line 216 of file SimEngine.cpp. References se_core::InitListeners::castCleanupEngineEvent(), se_core::InitListeners::castPriorityCleanupEngineEvent(), and se_core::SimSchema::initListeners(). Referenced by se_core::SimSchema::cleanup(). |
|
Reset game. Cleans up all areas and prepares the engine for a new game. It will cast an InitListener::cleanupGameEvent() to registered listeners. Definition at line 247 of file SimEngine.cpp. References se_core::CompSchema::activeRoot(), se_core::InitListeners::castCleanupGameEvent(), se_core::RootComponent::cleanup(), se_core::Composite::cleanup(), se_core::SimSchema::initListeners(), LogWarning, se_core::SpawnManager::reset(), se_core::SpawnManager::resetAll(), and se_core::SimSchema::spawnManager(). |
|
Game loop.
Definition at line 77 of file SimEngine.cpp. References se_core::CompSchema::activeRoot(), se_core::InitListeners::castCleanupLevelEvent(), se_core::SimListeners::castRenderEvent(), se_core::InitListeners::castStartGameEvent(), se_core::InitListeners::castStopGameEvent(), se_core::SimSchema::engineListeners(), se_core::SimSchema::initListeners(), and se_core::Composite::setActive(). |
|
Initialise the simulation engine. This should be called once after the application starts up. It will cast an InitListener::initEngineEvent(), so make sure that listeners that should receive this event is registered first. Definition at line 204 of file SimEngine.cpp. References se_core::InitListeners::castInitEngineEvent(), se_core::InitListeners::castPriorityInitEngineEvent(), and se_core::SimSchema::initListeners(). Referenced by se_core::SimSchema::init(). |
|
Initialise engine for a new game. It will cast an InitListener::initGameEvent() to registered listeners. Definition at line 224 of file SimEngine.cpp. References se_core::CompSchema::activeRoot(), se_core::InitListeners::castInitGameEvent(), se_core::Composite::init(), se_core::SimSchema::initListeners(), and LogWarning. |
|
Returns value of game over flag.
Definition at line 162 of file SimEngine.hpp. |
|
Definition at line 62 of file SimEngine.hpp. |
|
Definition at line 63 of file SimEngine.hpp. |
|
Performs AI actions. Algorithm as follow: move() - precalced next coor becomes present coor slide() - slide on walls for all action channels: actionQueue.performScheduledActions() - performs actions for all action channels: actionQueue.scheduleNextActions() - scripts plans next action thingFactory.performDestructions() - destroy those who died this step apply() - precalc next coor testCollisions() - test and adjust for collisions for all action channels: actionQueue.beginNextInitiative() - cleans up action queue update scriptTracker - updates script (cutscene) tracker
Definition at line 162 of file SimEngine.cpp. References se_core::CompSchema::activeRoot(), se_core::InitListeners::castCleanupLevelEvent(), se_core::InitListeners::castInitLevelEvent(), se_core::SimSchema::initListeners(), LogWarning, se_core::SpawnManager::performDestructions(), se_core::Composite::setActive(), se_core::SimSchema::spawnManager(), and se_core::SpawnManager::step(). |
|
Reset the engine. After this, everything has to be loaded again. Definition at line 268 of file SimEngine.cpp. References se_core::SpawnManager::reset(), se_core::SpawnManager::resetAll(), and se_core::SimSchema::spawnManager(). |
|
Reset step counter.
Definition at line 125 of file SimEngine.hpp. |
|
Set the game over flag.
Definition at line 239 of file SimEngine.cpp. References LogDetail. |
|
Definition at line 71 of file SimEngine.cpp. |
|
Set or reset the multiple perform() flag. If true, the step() method will perform AI logic more than once if the AI has lagged behind the game clock. This means that movement will be smooth, but that screen updates may be skipped. If false, the AI will just skip the AI performs it is lagged behind ignoring the fact that it has lagged behind. This may make game movements jerky, but will make it easier to have a consistent number of screen updates per AI perform().
Definition at line 65 of file SimEngine.cpp. |
|
Performs simulation step and calls listeners. Call this method as often as possible within the game loop. Performs all AI actions. Also casts events that lower layers may hook on to to process stuff before the AI processing starts, or after the AI has caught up and become up to date.
Definition at line 106 of file SimEngine.cpp. References se_core::SimListeners::castPostSimTickEvent(), se_core::SimListeners::castPreSimTickEvent(), and se_core::SimSchema::engineListeners(). |
|
Get the adjusted game clock. The adjusted game clock for the presently perform()ing or last peform()ed AI step.
Definition at line 153 of file SimEngine.hpp. |
Home Page | SagaEngine trunk (updated nightly) reference generated Sun Dec 2 20:06:28 2007 by Doxygen version 1.3.9.1.