class
APlayerState
- Module
- Game
- Header
#include "Game/APlayerState.h"- Namespace
Mowo- Reflection
- Reflected by MowoHeaderTool
Constructors
| Signature | Name | Description |
|---|---|---|
APlayerState() | APlayerState |
Public functions
| Returns | Name | Description |
|---|---|---|
AController* | GetOwningController | The controller this state belongs to. |
void | SetOwningController | |
void | InitPlayer | Binds the actor to a session player. |
int32_t | GetPlayerId | |
bool | IsLocalPlayer | |
std::string | GetPlayerName | |
int32_t | GetScore | |
int32_t | GetTeam | |
float | GetPing | |
bool | IsReady | |
void | SetPlayerName | Writes. |
bool | AddScore | |
bool | SetScore | |
bool | SetTeam | |
EntityID | GetRecordEntity | The session record's ECS entity, INVALID_ENTITY when there is none yet. |
T* | FindRecordComponent | A game's replicated per-player component on the record entity. |
T* | EnsureRecordComponent |
Function details
APlayerState
C++
APlayerState()GetOwningController
C++
AController* GetOwningController() constThe controller this state belongs to. A hot reload that respawns this actor restores the link by identity, which is how the controller finds its new state again.
SetOwningController
C++
void SetOwningController(AController* controller)InitPlayer
C++
void InitPlayer(uint32_t playerId, bool isLocal)Binds the actor to a session player. 0 with isLocal true follows this machine's player id, which the session assigns after the match began.
GetPlayerId
C++
int32_t GetPlayerId() constIsLocalPlayer
C++
bool IsLocalPlayer() constGetPlayerName
C++
std::string GetPlayerName() constGetScore
C++
int32_t GetScore() constGetTeam
C++
int32_t GetTeam() constGetPing
C++
float GetPing() constIsReady
C++
bool IsReady() constSetPlayerName
C++
void SetPlayerName(const std::string& name)Writes. The session record is the host's: on a client they change nothing there and return false. Without a session the actor's own copy changes.
AddScore
C++
bool AddScore(int32_t delta)SetScore
C++
bool SetScore(int32_t score)SetTeam
C++
bool SetTeam(int32_t team)GetRecordEntity
C++
EntityID GetRecordEntity() constThe session record's ECS entity, INVALID_ENTITY when there is none yet.
FindRecordComponent
C++
template<typename T> T* FindRecordComponent() constA game's replicated per-player component on the record entity. Find reads on every machine; Ensure adds it and is meaningful on the host only (a client's record is a replicated ghost, a component added there is not sent).
EnsureRecordComponent
C++
template<typename T> T* EnsureRecordComponent()Generated from Game/APlayerState.h via game.json · Dec 5, 2026Version 1.1.0