Module |
|
Header |
/Engine/Source/Runtime/Engine/Classes/GameFramework/GameState.h |
Include |
#include "GameFramework/GameState.h" |
class AGameState : public AGameStateBase
GameState is a subclass of GameStateBase that behaves like a multiplayer match-based game. It is tied to functionality in GameMode.
Name | Description | ||
---|---|---|---|
|
int32 |
ElapsedTime |
Elapsed game time since match has started. |
|
MatchState |
What match state we are currently in |
|
|
PreviousMatchState |
Previous map state, used to handle if multiple transitions happen per frame |
|
|
TimerHandle_DefaultTimer |
Handle for efficient management of DefaultTimer timer |
Name | Description | |
---|---|---|
|
AGameState ( |
Name | Description | ||
---|---|---|---|
|
void |
DefaultTimer() |
Called periodically, overridden by subclasses |
|
GetMatchState() |
Returns the current match state, this is an accessor to protect the state machine flow |
|
|
void |
HandleLeavingMap() |
Called when the match transitions to LeavingMap |
|
void |
HandleMatchHasEnded() |
Called when the map transitions to WaitingPostMatch |
|
void |
HandleMatchHasStarted() |
Called when the state transitions to InProgress |
|
void |
HandleMatchIsWaitingToStart() |
Called when the state transitions to WaitingToStart |
|
bool |
IsMatchInProgress() |
Returns true if we're in progress |
|
void |
OnRep_ElapsedTime() |
Gives clients the chance to do something when time gets updates |
|
void |
OnRep_MatchState() |
Match state has changed |
|
void |
SetMatchState ( |
Updates the match state and calls the appropriate transition functions, only valid on server |
Name | Description | ||
---|---|---|---|
|
float |
GetPlayerRespawnDelay ( |
Returns how much time needs to be spent before a player can respawn |
|
float |
GetPlayerStartTime ( |
Returns the time that should be used as when a player started |
|
void |
HandleBeginPlay() |
Called by game mode to set the started play bool |
|
bool |
HasMatchEnded() |
Returns true if match is WaitingPostMatch or later |
|
bool |
HasMatchStarted() |
Returns true if the world has started match (called MatchStarted callbacks) |
|
void |
ReceivedGameModeClass() |
Called when the GameClass property is set (at startup for the server, after the variable has been replicated on clients) |
Name | Description | ||
---|---|---|---|
|
void |
PostInitializeComponents() |
Allow actors to initialize themselves on the C++ side after all of their components have been initialized, only called during gameplay |