23 uint32_t serverTick) {
32 for (
auto &entity : entities) {
34 snapshot.
entities.push_back(entitySnapshot);
84 snapshot.
velX = dir.x * speed;
85 snapshot.
velY = dir.y * speed;
101 }
catch (
const std::exception &e) {
102 LOG_ERROR(
"Error serializing entity ", entityId,
": ", e.what());
Component representing entity health and invincibility.
int getCurrentHealth() const
Get current health points.
int getMaxHealth() const
Get maximum health points.
Component identifying an entity as a player with game statistics.
int getPlayerId() const
Get player ID.
Component representing movement direction and speed.
Vector2 getDirection() const
Get the direction vector.
float getSpeed() const
Get the movement speed.
High-level ECS manager providing clean server-side API.
std::vector< Entity > query()
Get all entities with specific components.
Entity getEntity(Address address)
Get an entity wrapper from an address.
High-level entity wrapper providing fluent interface.
bool has() const
Check if this entity has a specific component.
T & get()
Get a component from this entity.
static GameStateSnapshot createDeltaUpdate(ecs::wrapper::ECSWorld &world, uint32_t serverTick, const GameStateSnapshot &lastSnapshot)
Create a delta update (changed entities only)
static EntitySnapshot serializeEntity(ecs::wrapper::ECSWorld &world, uint32_t entityId)
Serialize entity to network format.
static GameStateSnapshot createFullSnapshot(ecs::wrapper::ECSWorld &world, uint32_t serverTick)
Create a full game state snapshot.
Serialized entity state for network transmission.
Complete game state at a given tick.
std::vector< EntitySnapshot > entities
uint32_t activePlayerCount