40ECSNET_API
extern component_t COMPONENT_NETWORKED_ENTITY;
51static inline void networked_entity_serialize(
const void *src, uint8_t *dst) {
53 memcpy(dst, &ne->
network_id,
sizeof(uint32_t));
65static inline void networked_entity_deserialize(
const uint8_t *buffer_in,
void *data_out) {
67 memcpy(&ne->
network_id, buffer_in,
sizeof(uint32_t));
68 memcpy(&ne->
interest_groups, buffer_in +
sizeof(uint32_t),
sizeof(uint32_t));
77static inline void ecs_register_networked_component(
ecs_t *ecs) {
80 .name =
"NetworkedEntity",
81 .serialize = networked_entity_serialize,
82 .deserialize = networked_entity_deserialize,
84 COMPONENT_NETWORKED_ENTITY = ecs_register_component(ecs, desc);
uint32_t interest_mask_t
Bitmask type for representing interest groups (up to 32 groups).
Definition networked_entity.h:22
Definition ecs_types.h:77
Internal structure representing the ECS world state. This holds:
Definition ecs_internal.h:44
Component representing network identity and interest groups.
Definition networked_entity.h:31
uint32_t network_id
Globally unique ID assigned by the server.
Definition networked_entity.h:32
interest_mask_t interest_groups
Bitmask of interest groups.
Definition networked_entity.h:33