Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
aegis2d::ecs::NetworkId Struct Reference

Identity of an entity shared by the server and the clients. More...

#include <aegis2d/ecs/components.hpp>

Static Public Member Functions

static constexpr NetworkId of (Entity entity) noexcept
 Network id of a server entity.
 

Public Attributes

Entity::Id value = 0
 The server entity's Entity::id().
 

Friends

constexpr bool operator== (const NetworkId &, const NetworkId &) noexcept=default
 Compares the ids.
 

Detailed Description

Identity of an entity shared by the server and the clients.

The server simulates the world and gives each replicated entity the id of its own handle; snapshots and events name entities by this id, and each client maps it to its local entity, whose handle is unrelated.

Member Function Documentation

◆ of()

static constexpr NetworkId aegis2d::ecs::NetworkId::of ( Entity  entity)
inlinestaticconstexprnoexcept

Network id of a server entity.

Parameters
entityHandle on the server.
Returns
NetworkId{entity.id()}.

Friends And Related Symbol Documentation

◆ operator==

constexpr bool operator== ( const NetworkId &  ,
const NetworkId &   
)
friend

Compares the ids.

Member Data Documentation

◆ value

Entity::Id aegis2d::ecs::NetworkId::value = 0

The server entity's Entity::id().


The documentation for this struct was generated from the following file: