Open 3D Engine GameState Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
GameState::GameStateSystemComponent Class Reference

#include <GameStateSystemComponent.h>

Inherits AZ::Component, AZ::TickBus::Handler, and GameStateRequestBus::Handler.

Public Member Functions

 AZ_COMPONENT (GameStateSystemComponent, "{03A10E41-3339-42C1-A6C8-A81327CB034B}")
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 AZ::ComponentDescriptor::Reflect
 
static void GetProvidedServices (AZ::ComponentDescriptor::DependencyArrayType &provided)
 AZ::ComponentDescriptor::GetProvidedServices
 
static void GetIncompatibleServices (AZ::ComponentDescriptor::DependencyArrayType &incompatible)
 AZ::ComponentDescriptor::GetIncompatibleServices
 

Protected Member Functions

void Activate () override
 AZ::Component::Activate
 
void Deactivate () override
 AZ::Component::Deactivate
 
int GetTickOrder () override
 AZ::TickEvents::GetTickOrder
 
void OnTick (float deltaTime, AZ::ScriptTimePoint scriptTimePoint) override
 AZ::TickEvents::OnTick
 
void UpdateActiveGameState () override
 GameState::GameStateRequests::UpdateActiveGameState
 
AZStd::shared_ptr< IGameStateGetActiveGameState () override
 GameState::GameStateRequests::GetActiveGameState
 
bool PushGameState (AZStd::shared_ptr< IGameState > newGameState) override
 GameState::GameStateRequests::PushGameState
 
bool PopActiveGameState () override
 GameState::GameStateRequests::PopActiveGameState
 
void PopAllGameStates () override
 GameState::GameStateRequests::PopAllGameStates
 
bool ReplaceActiveGameState (AZStd::shared_ptr< IGameState > newGameState) override
 GameState::GameStateRequests::ReplaceActiveGameState
 
bool DoesStackContainGameStateOfTypeId (const AZ::TypeId &gameStateTypeId) override
 GameState::GameStateRequests::DoesStackContainGameStateOfTypeId
 
bool AddGameStateFactoryOverrideForTypeId (const AZ::TypeId &gameStateTypeId, GameStateFactory factory) override
 GameState::GameStateRequests::AddGameStateFactoryOverrideForTypeId
 
bool RemoveGameStateFactoryOverrideForTypeId (const AZ::TypeId &gameStateTypeId) override
 GameState::GameStateRequests::RemoveGameStateFactoryOverrideForTypeId
 
GameStateFactory GetGameStateFactoryOverrideForTypeId (const AZ::TypeId &gameStateTypeId) override
 GameState::GameStateRequests::GetGameStateFactoryOverrideForTypeId
 

Detailed Description

This system component manages game state instances and the transitions between them. A few default game states are implemented in the GameStateSamples Gem, and these can be extended as needed in order to provide a custom experience for each game, but it's also possible to create completely new states by inheriting from the abstract GameState::IGameState class. States are managed using a stack (pushdown automaton) in order to maintain their history.


The documentation for this class was generated from the following file: