GameState Class Reference
#include <GameState.h>
![](../class_game_state.png)
# Public Types | |
enum | stopClocks |
# Public Member Functions | |
void | constructor () |
Class' constructor. | |
override bool | handleMessage (Telegram telegram) |
override void | start (void *owner) |
override void | update (void *owner) |
override void | stop (void *owner) |
override void | pause (void *owner) |
override void | unpause (void *owner) |
override bool | processMessage (void *owner, Telegram telegram) |
void | configureStage (StageSpec *stageSpec, VirtualList positionedActorsToIgnore) |
UIContainer | getUIContainer () |
void | purgeComponentManagers () |
Force the purging of deleted components. | |
void | startClocks () |
Start all the clocks. | |
void | pauseClocks () |
Pause all the clocks. | |
void | unpauseClocks () |
Unpause all the clocks. | |
void | stopClocks () |
Stop all the clocks. | |
void | startClock (uint32 clockEnum) |
void | pauseClock (uint32 clockEnum) |
void | unpauseClock (uint32 clockEnum) |
void | stopClock (uint32 clockEnum) |
void | applyTransformationsUI () |
Update the UI's children' global transformations. | |
bool | propagateMessage (int32 message) |
bool | propagateString (const char *string) |
Actor | getActorByName (const char *actorName) |
void | showActorWithName (const char *actorName) |
void | hideActorWithName (const char *actorName) |
void | changeFramerate (int16 targetFPS, int32 duration) |
void | streamAll () |
Force to completely stream in and out actors and to initialize all. | |
bool | lockFrameRate () |
void | printClocks (int16 x, int16 y) |
virtual void | enter (void *owner) |
virtual void | execute (void *owner) |
virtual void | exit (void *owner) |
virtual void | suspend (void *owner) |
virtual void | resume (void *owner) |
virtual void | processUserInput (const UserInput *userInput) |
virtual bool | isVersusMode () |
# Protected Attributes | |
UIContainer | uiContainer |
A container for actors that componse the UI. | |
Stage | stage |
A container for the game entites. | |
ComponentManager | componentManagers [kComponentTypes] |
Array of component managers. | |
Clock | logicsClock |
A clock for logics. | |
Clock | messagingClock |
A clock for messaging. | |
Clock | animationsClock |
A clock for animations. | |
Clock | physicsClock |
A clock for physics. | |
bool | stream |
Flags to enable or disable the streaming. | |
bool | transform |
Flags to enable or disable the transformations. | |
bool | processBehaviors |
Flags to enable or disable the behavior processing. | |
bool | processMutators |
Flags to enable or disable the mutator processing. | |
bool | updatePhysics |
Flags to enable or disable the physical simulations. | |
bool | processCollisions |
Flags to enable or disable the collision detection and processing. | |
uint8 | framerate |
bool | lockFrameRate |
If false, the game loop runs unlocked. |
# Additional Inherited Members | |
![]() | |
void | constructor () |
Class's constructor. | |
void | destructor () |
Class's destructor. |
# Detailed Description
Class GameState
Inherits from State
Implements a state that the VUEngine's state machine can transition into.
Definition at line 55 of file GameState.h.
# Member Enumeration Documentation
# stopClocks
enum void GameState::stopClocks |
Definition at line 36 of file GameState.h.
# Member Function Documentation
# applyTransformationsUI()
void GameState::applyTransformationsUI | ( | ) |
Update the UI's children' global transformations.
Definition at line 816 of file GameState.c.
# changeFramerate()
Change the target frame rate.
- Parameters
-
targetFPS New target frame rate duration Amount of time to keep the change on the frame rate before setting back the default target (0 or negative to make it permanent as long as the state is active)
Definition at line 545 of file GameState.c.
# configureStage()
void GameState::configureStage | ( | StageSpec * | stageSpec, |
VirtualList | positionedActorsToIgnore ) |
Configure the stage with the provided stage spec.
- Parameters
-
stageSpec Specification that determines how to configure the stage positionedActorsToIgnore List of positioned actor structs to register for streaming
Definition at line 326 of file GameState.c.
# constructor()
void GameState::constructor | ( | ) |
Class' constructor.
Definition at line 46 of file GameState.c.
# enter()
|
virtual |
Prepares the object to enter this state.
- Parameters
-
owner Object that is entering in this state
Reimplemented in SoundTestState.
Definition at line 607 of file GameState.c.
# execute()
|
virtual |
Updates the object in this state.
- Parameters
-
owner Object that is in this state
Definition at line 612 of file GameState.c.
# exit()
|
virtual |
Prepares the object to exit this state.
- Parameters
-
owner Object that is exiting this state
Definition at line 617 of file GameState.c.
# getActorByName()
Actor GameState::getActorByName | ( | const char * | actorName | ) |
Find a stage's child (grand child, etc.) by its name.
- Parameters
-
actorName Name to look for
Definition at line 499 of file GameState.c.
# getUIContainer()
UIContainer GameState::getUIContainer | ( | ) |
# handleMessage()
Receive and process a Telegram.
- Parameters
-
telegram Received telegram to process
- Returns
- True if the telegram was processed
Reimplemented from ListenerObject.
Definition at line 114 of file GameState.c.
# hideActorWithName()
void GameState::hideActorWithName | ( | const char * | actorName | ) |
Hide a stage's child (grand child, etc.) with the provided name.
- Parameters
-
actorName Name to look for
Definition at line 528 of file GameState.c.
# isVersusMode()
|
virtual |
Check if the game state is in versus mode.
- Returns
- True if the state is in versus mode; false otherwise
Definition at line 637 of file GameState.c.
# lockFrameRate()
bool GameState::lockFrameRate | ( | ) |
Check if the framerate is locked or not
- Returns
- True if the framerate is locked; false otherwise
# pause()
|
virtual |
Prepares the object to become inactive in this state.
- Parameters
-
owner Object that is in this state
Reimplemented from State.
Definition at line 217 of file GameState.c.
# pauseClock()
void GameState::pauseClock | ( | uint32 | clockEnum | ) |
Pause the clock used for logics.
- Parameters
-
clockEnum Enum that identifies the clock to pause
Definition at line 434 of file GameState.c.
# pauseClocks()
void GameState::pauseClocks | ( | ) |
Pause all the clocks.
Definition at line 392 of file GameState.c.
# printClocks()
Print the clocks.
- Parameters
-
x Screen x coordinate where to print y Screen y coordinate where to print
Definition at line 593 of file GameState.c.
# processMessage()
# processUserInput()
|
virtual |
Process the provided user input.
- Parameters
-
userInput Struct with the current user input information
Reimplemented in ToolState.
Definition at line 632 of file GameState.c.
# propagateMessage()
Propagate an integer message through the whole parenting hierarchy of the stage (children, grand children, etc.).
- Parameters
-
message The message to propagate
- Returns
- True if some actor processed the message
Definition at line 470 of file GameState.c.
# propagateString()
bool GameState::propagateString | ( | const char * | string | ) |
Propagate a string through the whole parenting hierarchy of the stage (children, grand children, etc.).
- Parameters
-
string The string to propagate
- Returns
- True if some actor processed the string
Definition at line 487 of file GameState.c.
# purgeComponentManagers()
void GameState::purgeComponentManagers | ( | ) |
Force the purging of deleted components.
Definition at line 360 of file GameState.c.
# resume()
|
virtual |
Prepares the object to become active in this state.
- Parameters
-
owner Object that is in this state
Definition at line 627 of file GameState.c.
# showActorWithName()
void GameState::showActorWithName | ( | const char * | actorName | ) |
Show a stage's child (grand child, etc.) with the provided name.
- Parameters
-
actorName Name to look for
Definition at line 511 of file GameState.c.
# start()
|
virtual |
Prepares the object to enter this state.
- Parameters
-
owner Object that is entering in this state
Reimplemented from State.
Reimplemented in ToolState.
Definition at line 135 of file GameState.c.
# startClock()
void GameState::startClock | ( | uint32 | clockEnum | ) |
Start the clock used for logics.
- Parameters
-
clockEnum Enum that identifies the clock to start
Definition at line 422 of file GameState.c.
# startClocks()
void GameState::startClocks | ( | ) |
Start all the clocks.
Definition at line 382 of file GameState.c.
# stop()
|
virtual |
Prepares the object to exit this state.
- Parameters
-
owner Object that is exiting this state
Reimplemented from State.
Reimplemented in ToolState.
Definition at line 193 of file GameState.c.
# stopClock()
void GameState::stopClock | ( | uint32 | clockEnum | ) |
Stop the clock used for logics.
- Parameters
-
clockEnum Enum that identifies the clock to stop
Definition at line 458 of file GameState.c.
# stopClocks()
void GameState::stopClocks | ( | ) |
Stop all the clocks.
# streamAll()
void GameState::streamAll | ( | ) |
Force to completely stream in and out actors and to initialize all.
Definition at line 563 of file GameState.c.
# suspend()
|
virtual |
Prepares the object to become inactive in this state.
- Parameters
-
owner Object that is in this state
Definition at line 622 of file GameState.c.
# unpause()
|
virtual |
Prepares the object to become active in this state.
- Parameters
-
owner Object that is in this state
Reimplemented from State.
Definition at line 256 of file GameState.c.
# unpauseClock()
void GameState::unpauseClock | ( | uint32 | clockEnum | ) |
Unpause the clock used for logics.
- Parameters
-
clockEnum Enum that identifies the clock to unpause
Definition at line 446 of file GameState.c.
# unpauseClocks()
void GameState::unpauseClocks | ( | ) |
Unpause all the clocks.
Definition at line 402 of file GameState.c.
# update()
|
virtual |
Updates the object in this state.
- Parameters
-
owner Object that is in this state
Reimplemented from State.
Reimplemented in ToolState.
Definition at line 156 of file GameState.c.
# Member Data Documentation
# animationsClock
|
protected |
A clock for animations.
Definition at line 75 of file GameState.h.
# componentManagers
|
protected |
Array of component managers.
Definition at line 66 of file GameState.h.
# framerate
|
protected |
Each game state needs to keep track of the frame rate that it runs at in case it is paused and resumed
Definition at line 100 of file GameState.h.
# lockFrameRate
|
protected |
If false, the game loop runs unlocked.
Definition at line 103 of file GameState.h.
# logicsClock
|
protected |
A clock for logics.
Definition at line 69 of file GameState.h.
# messagingClock
|
protected |
A clock for messaging.
Definition at line 72 of file GameState.h.
# physicsClock
|
protected |
A clock for physics.
Definition at line 78 of file GameState.h.
# processBehaviors
|
protected |
Flags to enable or disable the behavior processing.
Definition at line 87 of file GameState.h.
# processCollisions
|
protected |
Flags to enable or disable the collision detection and processing.
Definition at line 96 of file GameState.h.
# processMutators
|
protected |
Flags to enable or disable the mutator processing.
Definition at line 90 of file GameState.h.
# stage
|
protected |
A container for the game entites.
Definition at line 63 of file GameState.h.
# stream
|
protected |
Flags to enable or disable the streaming.
Definition at line 81 of file GameState.h.
# transform
|
protected |
Flags to enable or disable the transformations.
Definition at line 84 of file GameState.h.
# uiContainer
|
protected |
A container for actors that componse the UI.
Definition at line 60 of file GameState.h.
# updatePhysics
|
protected |
Flags to enable or disable the physical simulations.
Definition at line 93 of file GameState.h.
The documentation for this class was generated from the following files:
- VUEngine-Core/source/State/GameState/GameState.h
- VUEngine-Core/source/State/GameState/GameState.c