#include <GameLogic.h>
Inherits SubsystemInterface, and Snapshot.
Inherited by W3DGameLogic.
Public Member Functions | |
| GameLogic (void) | |
| virtual | ~GameLogic () |
| virtual void | init (void) |
| Initialize or re-initialize the instance. | |
| virtual void | reset (void) |
| Reset the logic system. | |
| virtual void | update (void) |
| update the world | |
| void | processCommandList (CommandList *list) |
| process the command list | |
| void | prepareNewGame (Int gameMode, GameDifficulty diff, Int rankPoints) |
| prepare for new game | |
| void | logicMessageDispatcher (GameMessage *msg, void *userData) |
| Logic command list processing. | |
| void | registerObject (Object *obj) |
| Given an object, register it with the GameLogic and give it a unique ID. | |
| void | addObjectToLookupTable (Object *obj) |
| add object ID to hash lookup table | |
| void | removeObjectFromLookupTable (Object *obj) |
| remove object ID from hash lookup table | |
| void | setWidth (Real width) |
| Sets the width of the world. | |
| Real | getWidth (void) |
| Returns the width of the world. | |
| void | setHeight (Real height) |
| Sets the height of the world. | |
| Real | getHeight (void) |
| Returns the height of the world. | |
| Bool | isInGameLogicUpdate (void) const |
| UnsignedInt | getFrame (void) |
| Returns the current simulation frame number. | |
| UnsignedInt | getCRC (Int mode=CRC_CACHED, AsciiString deepCRCFileName=AsciiString::TheEmptyString) |
| Returns the CRC. | |
| void | setObjectIDCounter (ObjectID nextObjID) |
| ObjectID | getObjectIDCounter (void) |
| void | setBuildableStatusOverride (const ThingTemplate *tt, BuildableStatus bs) |
| Bool | findBuildableStatusOverride (const ThingTemplate *tt, BuildableStatus &bs) const |
| void | setControlBarOverride (const AsciiString &commandSetName, Int slot, ConstCommandButtonPtr commandButton) |
| Bool | findControlBarOverride (const AsciiString &commandSetName, Int slot, ConstCommandButtonPtr &commandButton) const |
| Object * | friend_createObject (const ThingTemplate *thing, const ObjectStatusMaskType &objectStatusMask, Team *team) |
| create an object given the thing template. (Only for use by ThingFactory.) | |
| void | destroyObject (Object *obj) |
| Mark object as destroyed for later deletion. | |
| Object * | findObjectByID (ObjectID id) |
| Given an ObjectID, return a pointer to the object. | |
| Object * | getFirstObject (void) |
| Returns the "first" object in the world. When used with the object method "getNextObject()", all objects in the world can be iterated. | |
| ObjectID | allocateObjectID (void) |
| Returns a new unique object id. | |
| void | startNewGame (Bool loadSaveGame) |
| void | loadMapINI (AsciiString mapName) |
| void | updateLoadProgress (Int progress) |
| void | deleteLoadScreen (void) |
| void | setLoadingMap (Bool loading) |
| void | setLoadingSave (Bool loading) |
| void | setClearingGameData (Bool clearing) |
| void | setGameMode (Int mode) |
| Int | getGameMode (void) |
| Bool | isInGame (void) |
| Bool | isInLanGame (void) |
| Bool | isInSinglePlayerGame (void) |
| Bool | isInSkirmishGame (void) |
| Bool | isInReplayGame (void) |
| Bool | isInInternetGame (void) |
| Bool | isInShellGame (void) |
| Bool | isInMultiplayerGame (void) |
| Bool | isLoadingMap () const |
| Bool | isLoadingSave () const |
| Bool | isClearingGameData () const |
| void | enableScoring (Bool score) |
| Bool | isScoringEnabled () const |
| void | setShowBehindBuildingMarkers (Bool b) |
| Bool | getShowBehindBuildingMarkers () const |
| void | setDrawIconUI (Bool b) |
| Bool | getDrawIconUI () const |
| void | setShowDynamicLOD (Bool b) |
| Bool | getShowDynamicLOD () const |
| void | setHulkMaxLifetimeOverride (Int b) |
| Int | getHulkMaxLifetimeOverride () const |
| Bool | isIntroMoviePlaying () |
| void | updateObjectsChangedTriggerAreas (void) |
| UnsignedInt | getFrameObjectsChangedTriggerAreas (void) |
| void | clearGameData (Bool showScoreScreen=TRUE) |
| Clear the game data. | |
| void | closeWindows (void) |
| void | sendObjectCreated (Object *obj) |
| void | sendObjectDestroyed (Object *obj) |
| void | bindObjectAndDrawable (Object *obj, Drawable *draw) |
| void | setGamePaused (Bool paused, Bool pauseMusic=TRUE) |
| Bool | isGamePaused (void) |
| Bool | getInputEnabledMemory (void) |
| void | processProgress (Int playerId, Int percentage) |
| void | processProgressComplete (Int playerId) |
| Bool | isProgressComplete (void) |
| @TODO: Add check to account for timeouts | |
| void | timeOutGameStart (void) |
| void | initTimeOutValues (void) |
| UnsignedInt | getObjectCount (void) |
| Int | getRankLevelLimit () const |
| void | setRankLevelLimit (Int limit) |
| Int | getRankPointsToAddAtGameStart () const |
| UnsignedShort | getSuperweaponRestriction (void) const |
| Get any optional limits on superweapons. | |
| void | setSuperweaponRestriction (void) |
| void | selectObject (Object *obj, Bool createNewSelection, PlayerMaskType playerMask, Bool affectClient=FALSE) |
| void | deselectObject (Object *obj, PlayerMaskType playerMask, Bool affectClient=FALSE) |
| void | friend_awakenUpdateModule (Object *obj, UpdateModulePtr update, UnsignedInt whenToWakeUp) |
Public Member Functions inherited from SubsystemInterface | |
| SubsystemInterface () | |
| virtual | ~SubsystemInterface () |
| virtual void | postProcessLoad () |
| virtual void | draw (void) |
| void | UPDATE (void) |
| void | DRAW (void) |
| AsciiString | getName (void) |
| void | setName (AsciiString name) |
Public Member Functions inherited from Snapshot | |
| Snapshot (void) | |
| ~Snapshot (void) | |
Protected Member Functions | |
| virtual void | crc (Xfer *xfer) |
| virtual void | xfer (Xfer *xfer) |
| virtual void | loadPostProcess (void) |
Additional Inherited Members | |
Protected Attributes inherited from SubsystemInterface | |
| AsciiString | m_name |
The implementation of GameLogic
Definition at line 104 of file GameLogic.h.
| GameLogic::GameLogic | ( | void | ) |
GameLogic class constructor
Definition at line 223 of file GameLogic.cpp.
|
virtual |
GameLogic class destructor, the destruction order should mirror the initialization order
Definition at line 330 of file GameLogic.cpp.
| void GameLogic::addObjectToLookupTable | ( | Object * | obj | ) |
add object ID to hash lookup table
Add object ID to the lookup table
Definition at line 3851 of file GameLogic.cpp.
| ObjectID GameLogic::allocateObjectID | ( | void | ) |
Returns a new unique object id.
Return a new unique object id.
Definition at line 3840 of file GameLogic.cpp.
Definition at line 4149 of file GameLogic.cpp.
Clear the game data.
Definition at line 247 of file GameLogicDispatch.cpp.
| void GameLogic::closeWindows | ( | void | ) |
Definition at line 226 of file GameLogicDispatch.cpp.
|
protectedvirtual |
| void GameLogic::deleteLoadScreen | ( | void | ) |
Delete the load screen
Definition at line 1088 of file GameLogic.cpp.
| void GameLogic::deselectObject | ( | Object * | obj, |
| PlayerMaskType | playerMask, | ||
| Bool | affectClient = FALSE ) |
Definition at line 2670 of file GameLogic.cpp.
| void GameLogic::destroyObject | ( | Object * | obj | ) |
Mark object as destroyed for later deletion.
Mark the object as destroyed, and place on list for deletion at the end of the next update. This is the only interface to destroy objects - objects cannot be directly deleted.
Definition at line 3959 of file GameLogic.cpp.
|
inline |
Definition at line 190 of file GameLogic.h.
| Bool GameLogic::findBuildableStatusOverride | ( | const ThingTemplate * | tt, |
| BuildableStatus & | bs ) const |
Definition at line 4398 of file GameLogic.cpp.
| Bool GameLogic::findControlBarOverride | ( | const AsciiString & | commandSetName, |
| Int | slot, | ||
| ConstCommandButtonPtr & | commandButton ) const |
Definition at line 4422 of file GameLogic.cpp.
Given an ObjectID, return a pointer to the object.
Definition at line 410 of file GameLogic.h.
| void GameLogic::friend_awakenUpdateModule | ( | Object * | obj, |
| UpdateModulePtr | update, | ||
| UnsignedInt | whenToWakeUp ) |
Definition at line 2983 of file GameLogic.cpp.
| Object * GameLogic::friend_createObject | ( | const ThingTemplate * | thing, |
| const ObjectStatusMaskType & | statusBits, | ||
| Team * | team ) |
create an object given the thing template. (Only for use by ThingFactory.)
create an object based on the thing template, the reason that this is here and not in the ThingFactory is so that we can mirror what the creation process is on the client side because clients have specific device dependent drawables (such as a W3DDrawable derived from Drawable). here we will allocate an object of the correct type based on thing template properties
if we want to have the thing manager actually contain the pools of object and drawable storage it seems OK to have it be friends with the GameLogic/Client for those purposes, or we could put the allocation pools in the GameLogic and GameClient themselves
Definition at line 3946 of file GameLogic.cpp.
| UnsignedInt GameLogic::getCRC | ( | Int | mode = CRC_CACHED, |
| AsciiString | deepCRCFileName = AsciiString::TheEmptyString ) |
Returns the CRC.
Definition at line 4012 of file GameLogic.cpp.
|
inline |
Definition at line 197 of file GameLogic.h.
| Object * GameLogic::getFirstObject | ( | void | ) |
Returns the "first" object in the world. When used with the object method "getNextObject()", all objects in the world can be iterated.
Return the first object in the world list
Definition at line 3832 of file GameLogic.cpp.
|
inline |
Returns the current simulation frame number.
Definition at line 397 of file GameLogic.h.
|
inline |
Definition at line 208 of file GameLogic.h.
|
inline |
Definition at line 401 of file GameLogic.h.
|
inline |
Returns the height of the world.
Definition at line 396 of file GameLogic.h.
|
inline |
Definition at line 203 of file GameLogic.h.
|
inline |
Definition at line 220 of file GameLogic.h.
| UnsignedInt GameLogic::getObjectCount | ( | void | ) |
returns the total number of objects in the world
Definition at line 4363 of file GameLogic.cpp.
|
inline |
Definition at line 143 of file GameLogic.h.
|
inline |
Definition at line 229 of file GameLogic.h.
|
inline |
Definition at line 237 of file GameLogic.h.
|
inline |
Definition at line 194 of file GameLogic.h.
|
inline |
Definition at line 200 of file GameLogic.h.
|
inline |
Get any optional limits on superweapons.
Definition at line 408 of file GameLogic.h.
|
inline |
Returns the width of the world.
Definition at line 394 of file GameLogic.h.
|
virtual |
Initialize or re-initialize the instance.
(re)initialize the instance.
Implements SubsystemInterface.
Definition at line 374 of file GameLogic.cpp.
| void GameLogic::initTimeOutValues | ( | void | ) |
Definition at line 4350 of file GameLogic.cpp.
|
inline |
Definition at line 188 of file GameLogic.h.
| Bool GameLogic::isGamePaused | ( | void | ) |
Return if the game is paused or not
Definition at line 4181 of file GameLogic.cpp.
|
inline |
Definition at line 399 of file GameLogic.h.
|
inline |
Definition at line 138 of file GameLogic.h.
|
inline |
Definition at line 406 of file GameLogic.h.
|
inline |
Definition at line 402 of file GameLogic.h.
|
inline |
Definition at line 404 of file GameLogic.h.
|
inline |
Definition at line 405 of file GameLogic.h.
|
inline |
Definition at line 407 of file GameLogic.h.
| Bool GameLogic::isInSinglePlayerGame | ( | void | ) |
Definition at line 299 of file GameLogic.cpp.
|
inline |
Definition at line 403 of file GameLogic.h.
| Bool GameLogic::isIntroMoviePlaying | ( | ) |
Definition at line 2611 of file GameLogic.cpp.
|
inline |
Definition at line 186 of file GameLogic.h.
|
inline |
Definition at line 187 of file GameLogic.h.
| Bool GameLogic::isProgressComplete | ( | void | ) |
@TODO: Add check to account for timeouts
Definition at line 4294 of file GameLogic.cpp.
|
inline |
Definition at line 191 of file GameLogic.h.
| void GameLogic::loadMapINI | ( | AsciiString | mapName | ) |
Definition at line 2391 of file GameLogic.cpp.
|
protectedvirtual |
| void GameLogic::logicMessageDispatcher | ( | GameMessage * | msg, |
| void * | userData ) |
Logic command list processing.
This message handles dispatches object command messages to the appropriate objects.
Definition at line 352 of file GameLogicDispatch.cpp.
| void GameLogic::prepareNewGame | ( | Int | gameMode, |
| GameDifficulty | diff, | ||
| Int | rankPoints ) |
| void GameLogic::processCommandList | ( | CommandList * | list | ) |
process the command list
Process the command list passed to the logic from the network
Definition at line 2540 of file GameLogic.cpp.
Definition at line 4263 of file GameLogic.cpp.
| void GameLogic::processProgressComplete | ( | Int | playerId | ) |
Whenever we get a progress complete packet for a Net Game, Set a flag that that player is ready
Definition at line 4274 of file GameLogic.cpp.
| void GameLogic::registerObject | ( | Object * | obj | ) |
Given an object, register it with the GameLogic and give it a unique ID.
Given an object, register it with the GameLogic and give it a unique ID.
Definition at line 3887 of file GameLogic.cpp.
| void GameLogic::removeObjectFromLookupTable | ( | Object * | obj | ) |
remove object ID from hash lookup table
Remove object from the ID lookup table
Definition at line 3871 of file GameLogic.cpp.
|
virtual |
Reset the logic system.
Reset the game logic systems
Implements SubsystemInterface.
Definition at line 434 of file GameLogic.cpp.
| void GameLogic::selectObject | ( | Object * | obj, |
| Bool | createNewSelection, | ||
| PlayerMaskType | playerMask, | ||
| Bool | affectClient = FALSE ) |
Definition at line 2619 of file GameLogic.cpp.
| void GameLogic::sendObjectCreated | ( | Object * | obj | ) |
A new GameLogic object has been constructed, therefore create a corresponding drawable and bind them together.
Definition at line 4137 of file GameLogic.cpp.
| void GameLogic::sendObjectDestroyed | ( | Object * | obj | ) |
Send notification of object destruction.
Definition at line 4158 of file GameLogic.cpp.
| void GameLogic::setBuildableStatusOverride | ( | const ThingTemplate * | tt, |
| BuildableStatus | bs ) |
Definition at line 4389 of file GameLogic.cpp.
|
inline |
Definition at line 171 of file GameLogic.h.
| void GameLogic::setControlBarOverride | ( | const AsciiString & | commandSetName, |
| Int | slot, | ||
| ConstCommandButtonPtr | commandButton ) |
Definition at line 4413 of file GameLogic.cpp.
|
inline |
Definition at line 196 of file GameLogic.h.
|
inline |
Definition at line 400 of file GameLogic.h.
Definition at line 4188 of file GameLogic.cpp.
|
inline |
Sets the height of the world.
Definition at line 395 of file GameLogic.h.
|
inline |
Definition at line 202 of file GameLogic.h.
|
inline |
Definition at line 169 of file GameLogic.h.
|
inline |
Definition at line 170 of file GameLogic.h.
|
inline |
Definition at line 142 of file GameLogic.h.
|
inline |
Definition at line 230 of file GameLogic.h.
|
inline |
Definition at line 193 of file GameLogic.h.
|
inline |
Definition at line 199 of file GameLogic.h.
| void GameLogic::setSuperweaponRestriction | ( | void | ) |
|
inline |
Sets the width of the world.
Definition at line 393 of file GameLogic.h.
| void GameLogic::startNewGame | ( | Bool | loadingSaveGame | ) |
Entry point for starting a new game, the engine is already in clean state at this point and ready to load up with all the data
< mark it so only a few select things are rendered during load
< mark it so only a few select things are rendered during load
ShowControlBar(FALSE);
< mark to resume rendering as normal
Definition at line 1105 of file GameLogic.cpp.
| void GameLogic::timeOutGameStart | ( | void | ) |
Definition at line 4342 of file GameLogic.cpp.
|
virtual |
update the world
Update all objects in the world by invoking their update() methods.
Implements SubsystemInterface.
Definition at line 3572 of file GameLogic.cpp.
| void GameLogic::updateLoadProgress | ( | Int | progress | ) |
Update the load screen progress
Definition at line 1077 of file GameLogic.cpp.
|
inline |
Definition at line 207 of file GameLogic.h.
|
protectedvirtual |
Load/Save game logic to xfer Version Info: 1: Initial version 2: Added m_isScoringEnabled flag (BGC) 3: Added polygon triggers (CBD) 4: Added block markers around object data, no version checking is done and therefore this version breaks compatibility with previous versions. (CBD) 5: Added xfering the BuildAssistant's sell list. 9: Added m_rankPointsToAddAtGameStart, or else on a load game, your RestartGame button will forget your exp 10: xfer m_superweaponRestriction
Implements Snapshot.
Definition at line 4690 of file GameLogic.cpp.