TNetSimStateAccessor

Accessors - helper structs that provide safe/cleaner access to the underlying NetSim states/events This is the equivlent of directly calling [TNetworkedSimulationModel::GetPendingStateRead()](API\Plugins\NetworkPrediction\TNetworkedSimulationModel\GetPendingStateRead) / GetPendingStateWrite()

Windows
MacOS
Linux

References

Module

NetworkPrediction

Header

/Engine/Plugins/Runtime/NetworkPrediction/Source/NetworkPrediction/Public/NetworkedSimulationModelTypes.h

Include

#include "NetworkedSimulationModelTypes.h"

Syntax

template<typename TState>
struct TNetSimStateAccessor

Remarks

Accessors - helper structs that provide safe/cleaner access to the underlying NetSim states/events This is the equivlent of directly calling TNetworkedSimulationModel::GetPendingStateRead() / GetPendingStateWrite()

This is useful because it is not always practical to have a typed pointer to your TNetworkedSimulationModel instance. For example, the TNetworkedSimulationModel may be templated and conditionally instantiated (for example fix tick vs non fixed tick models, and eventually we may offer more memory allocation related templated parameters).

Essentially, this allows you to plop a TNetSimStateAccessor<MyStateType> on a class and have it bind to any TNetworkedSimulationModel instantiation that has uses that type.

See additional comments in TNetworkedSimulationModel::GetPendingStateRead() / GetPendingStateWrite()

Functions

Name Description

Public function

void

 

Bind

(
    TNetworkSimModel* NetSimModel
)

Bind to the NetsimModel that we are accessing.

Public function

void

 

Clear()

Public function Const

const TState...

 

GetStateRead()

Gets the current (PendingFrame) state for reading.

Public function Const

TState *

 

GetStateWrite

(
    bool bHasAuthority
)

Gets the current (PendingFrame) state for writing.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss