GameState Class Reference

#include <GameState.h>

Inheritance diagram for GameState:
State ToolState AnimationInspectorState DebugState SoundTestState StageEditorState

# 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

- Private Member Functions inherited from State
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

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()

void GameState::changeFramerate ( int16 targetFPS,
int32 duration )

Change the target frame rate.

Parameters
targetFPSNew target frame rate
durationAmount 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
stageSpecSpecification that determines how to configure the stage
positionedActorsToIgnoreList 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()

void GameState::enter ( void * owner)
virtual

Prepares the object to enter this state.

Parameters
ownerObject that is entering in this state

Reimplemented in SoundTestState.

Definition at line 607 of file GameState.c.

# execute()

void GameState::execute ( void * owner)
virtual

Updates the object in this state.

Parameters
ownerObject that is in this state

Definition at line 612 of file GameState.c.

# exit()

void GameState::exit ( void * owner)
virtual

Prepares the object to exit this state.

Parameters
ownerObject 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
actorNameName to look for

Definition at line 499 of file GameState.c.

# getUIContainer()

UIContainer GameState::getUIContainer ( )

Retrieve the UI container.

Returns
UI Container

Definition at line 375 of file GameState.c.

# handleMessage()

bool GameState::handleMessage ( Telegram telegram)
virtual

Receive and process a Telegram.

Parameters
telegramReceived 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
actorNameName to look for

Definition at line 528 of file GameState.c.

# isVersusMode()

bool GameState::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()

void GameState::pause ( void * owner)
virtual

Prepares the object to become inactive in this state.

Parameters
ownerObject 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
clockEnumEnum 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()

void GameState::printClocks ( int16 x,
int16 y )

Print the clocks.

Parameters
xScreen x coordinate where to print
yScreen y coordinate where to print

Definition at line 593 of file GameState.c.

# processMessage()

bool GameState::processMessage ( void * owner,
Telegram telegram )
virtual

Process a Telegram sent to an object that is in this state.

Parameters
ownerObject that is in this state
telegramTelegram to process

Reimplemented from State.

Definition at line 313 of file GameState.c.

# processUserInput()

void GameState::processUserInput ( const UserInput * userInput)
virtual

Process the provided user input.

Parameters
userInputStruct with the current user input information

Reimplemented in ToolState.

Definition at line 632 of file GameState.c.

# propagateMessage()

bool GameState::propagateMessage ( int32 message)

Propagate an integer message through the whole parenting hierarchy of the stage (children, grand children, etc.).

Parameters
messageThe 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
stringThe 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()

void GameState::resume ( void * owner)
virtual

Prepares the object to become active in this state.

Parameters
ownerObject 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
actorNameName to look for

Definition at line 511 of file GameState.c.

# start()

void GameState::start ( void * owner)
virtual

Prepares the object to enter this state.

Parameters
ownerObject 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
clockEnumEnum 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()

void GameState::stop ( void * owner)
virtual

Prepares the object to exit this state.

Parameters
ownerObject 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
clockEnumEnum that identifies the clock to stop

Definition at line 458 of file GameState.c.

# 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()

void GameState::suspend ( void * owner)
virtual

Prepares the object to become inactive in this state.

Parameters
ownerObject that is in this state

Definition at line 622 of file GameState.c.

# unpause()

void GameState::unpause ( void * owner)
virtual

Prepares the object to become active in this state.

Parameters
ownerObject 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
clockEnumEnum 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()

void GameState::update ( void * owner)
virtual

Updates the object in this state.

Parameters
ownerObject that is in this state

Reimplemented from State.

Reimplemented in ToolState.

Definition at line 156 of file GameState.c.

# Member Data Documentation

# animationsClock

Clock GameState::animationsClock
protected

A clock for animations.

Definition at line 75 of file GameState.h.

# componentManagers

ComponentManager GameState::componentManagers[kComponentTypes]
protected

Array of component managers.

Definition at line 66 of file GameState.h.

# framerate

uint8 GameState::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

bool GameState::lockFrameRate
protected

If false, the game loop runs unlocked.

Definition at line 103 of file GameState.h.

# logicsClock

Clock GameState::logicsClock
protected

A clock for logics.

Definition at line 69 of file GameState.h.

# messagingClock

Clock GameState::messagingClock
protected

A clock for messaging.

Definition at line 72 of file GameState.h.

# physicsClock

Clock GameState::physicsClock
protected

A clock for physics.

Definition at line 78 of file GameState.h.

# processBehaviors

void GameState::processBehaviors
protected

Flags to enable or disable the behavior processing.

Definition at line 87 of file GameState.h.

# processCollisions

void GameState::processCollisions
protected

Flags to enable or disable the collision detection and processing.

Definition at line 96 of file GameState.h.

# processMutators

void GameState::processMutators
protected

Flags to enable or disable the mutator processing.

Definition at line 90 of file GameState.h.

# stage

Stage GameState::stage
protected

A container for the game entites.

Definition at line 63 of file GameState.h.

# stream

void GameState::stream
protected

Flags to enable or disable the streaming.

Definition at line 81 of file GameState.h.

# transform

bool GameState::transform
protected

Flags to enable or disable the transformations.

Definition at line 84 of file GameState.h.

# uiContainer

UIContainer GameState::uiContainer
protected

A container for actors that componse the UI.

Definition at line 60 of file GameState.h.

# updatePhysics

bool GameState::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: