This class allows entity netEntityIds to be looked up.
More...
#include <NetworkEntityTracker.h>
|
using | EntityMap = AZStd::unordered_map< NetEntityId, AZ::Entity * > |
|
using | NetEntityIdMap = AZStd::unordered_map< AZ::EntityId, NetEntityId > |
|
using | NetBindingMap = AZStd::unordered_map< AZ::Entity *, NetBindComponent * > |
|
using | iterator = EntityMap::iterator |
|
using | const_iterator = EntityMap::const_iterator |
|
|
void | Add (NetEntityId netEntityId, AZ::Entity *entity) |
|
void | RegisterNetBindComponent (AZ::Entity *entity, NetBindComponent *component) |
|
void | UnregisterNetBindComponent (NetBindComponent *component) |
|
NetworkEntityHandle | Get (NetEntityId netEntityId) |
| Returns an entity handle which can validate entity existence.
|
|
ConstNetworkEntityHandle | Get (NetEntityId netEntityId) const |
|
NetEntityId | Get (const AZ::EntityId &entityId) const |
| Returns Net Entity ID for a given AZ Entity ID.
|
|
bool | Exists (NetEntityId netEntityId) const |
| Returns true if the netEntityId exists.
|
|
AZ::Entity * | GetRaw (NetEntityId netEntityId) const |
| Get a raw pointer of an entity.
|
|
AZ::Entity * | Move (EntityMap::iterator iter) |
| Moves the given iterator out of the entity holder and returns the ptr.
|
|
NetBindComponent * | GetNetBindComponent (AZ::Entity *rawEntity) const |
|
uint32_t | GetChangeDirty (const AZ::Entity *entity) const |
|
uint32_t | GetDeleteChangeDirty () const |
|
uint32_t | GetAddChangeDirty () const |
|
| AZ_DISABLE_COPY_MOVE (NetworkEntityTracker) |
| Prevent copying and heap allocation.
|
|
|
iterator | begin () |
|
const_iterator | begin () const |
|
iterator | end () |
|
const_iterator | end () const |
|
iterator | find (NetEntityId netEntityId) |
|
const_iterator | find (NetEntityId netEntityId) const |
|
void | erase (NetEntityId netEntityId) |
|
iterator | erase (EntityMap::iterator iter) |
|
AZStd::size_t | size () const |
|
void | clear () |
|
This class allows entity netEntityIds to be looked up.
◆ Add()
void Multiplayer::NetworkEntityTracker::Add |
( |
NetEntityId |
netEntityId, |
|
|
AZ::Entity * |
entity |
|
) |
| |
Adds a networked entity to the tracker.
- Parameters
-
netEntityId | the networkId of the entity to add |
entity | pointer to the entity corresponding to the networkId |
◆ begin()
NetworkEntityTracker::iterator Multiplayer::NetworkEntityTracker::begin |
( |
| ) |
|
|
inline |
◆ GetChangeDirty()
uint32_t Multiplayer::NetworkEntityTracker::GetChangeDirty |
( |
const AZ::Entity * |
entity | ) |
const |
|
inline |
Dirty tracking optimizations to avoid unnecessary hash lookups. There are two counts, one for adds and one for deletes If an entity is nullptr, check adds to check to see if our entity was added again If an entity is not nullptr, check removes which reminds us to see if the entity no longer exists Passing in the entity into this helper assists in retrieving the correct count, so we do not need to store both counts inside each handle
◆ GetNetBindComponent()
NetBindComponent * Multiplayer::NetworkEntityTracker::GetNetBindComponent |
( |
AZ::Entity * |
rawEntity | ) |
const |
|
inline |
Retrieves the NetBindComponent for the provided AZ::Entity, nullptr if the entity does not have netbinding.
- Parameters
-
- Returns
- pointer to the entities NetBindComponent, or nullptr if the entity doesn't exist or does not have netbinding
◆ RegisterNetBindComponent()
void Multiplayer::NetworkEntityTracker::RegisterNetBindComponent |
( |
AZ::Entity * |
entity, |
|
|
NetBindComponent * |
component |
|
) |
| |
◆ UnregisterNetBindComponent()
void Multiplayer::NetworkEntityTracker::UnregisterNetBindComponent |
( |
NetBindComponent * |
component | ) |
|
The documentation for this class was generated from the following files:
- Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityTracker.h
- Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityTracker.inl