Navigation
Unreal Engine C++ API Reference > Runtime > Engine > GameFramework
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- AActor
- AInfo
- AGameStateBase
- AGameState
- AMoverExamplesGameState
References
Module | Engine |
Header | /Engine/Source/Runtime/Engine/Classes/GameFramework/GameState.h |
Include | #include "GameFramework/GameState.h" |
Syntax
UCLASS (MinimalAPI)
class AGameState : public AGameStateBase
Remarks
GameState is a subclass of GameStateBase that behaves like a multiplayer match-based game. It is tied to functionality in GameMode.
Variables
Type | Name | Description | |
---|---|---|---|
int32 | ElapsedTime | Elapsed game time since match has started. | |
FName | MatchState | What match state we are currently in | |
FName | PreviousMatchState | Previous map state, used to handle if multiple transitions happen per frame | |
FTimerHandle | TimerHandle_DefaultTimer | Handle for efficient management of DefaultTimer timer |
Constructors
Type | Name | Description | |
---|---|---|---|
AGameState
(
const FObjectInitializer& ObjectInitializer |
Functions
Type | Name | Description | |
---|---|---|---|
void | DefaultTimer () |
Called periodically, overridden by subclasses | |
FName | Returns the current match state, this is an accessor to protect the state machine flow | ||
void | Called when the match transitions to LeavingMap | ||
void | Called when the map transitions to WaitingPostMatch | ||
void | Called when the state transitions to InProgress | ||
void | Called when the state transitions to WaitingToStart | ||
bool | Returns true if we're in progress | ||
void | Gives clients the chance to do something when time gets updates | ||
void | Match state has changed | ||
void | SetMatchState
(
FName NewState |
Updates the match state and calls the appropriate transition functions, only valid on server |
Overridden from AGameStateBase
Type | Name | Description | |
---|---|---|---|
float | GetPlayerRespawnDelay
(
AController* Controller |
Returns how much time needs to be spent before a player can respawn | |
float | GetPlayerStartTime
(
AController* Controller |
Returns the time that should be used as when a player started | |
void | Called by game mode to set the started play bool | ||
bool | Returns true if match is WaitingPostMatch or later | ||
bool | Returns true if the world has started match (called MatchStarted callbacks) | ||
void | Called when the GameClass property is set (at startup for the server, after the variable has been replicated on clients) |
Overridden from AActor
Type | Name | Description | |
---|---|---|---|
void | Allow actors to initialize themselves on the C++ side after all of their components have been initialized, only called during gameplay |