Flecs v3.2
A fast entity component system (ECS) for C & C++
No Matches
snapshot.h File Reference

Snapshot addon. More...

Go to the source code of this file.


typedef struct ecs_snapshot_t ecs_snapshot_t
 A snapshot stores the state of a world in a particular point in time.


FLECS_API ecs_snapshot_tecs_snapshot_take (ecs_world_t *world)
 Create a snapshot.
FLECS_API ecs_snapshot_tecs_snapshot_take_w_iter (ecs_iter_t *iter)
 Create a filtered snapshot.
FLECS_API void ecs_snapshot_restore (ecs_world_t *world, ecs_snapshot_t *snapshot)
 Restore a snapshot.
FLECS_API ecs_iter_t ecs_snapshot_iter (ecs_snapshot_t *snapshot)
 Obtain iterator to snapshot data.
FLECS_API bool ecs_snapshot_next (ecs_iter_t *iter)
 Progress snapshot iterator.
FLECS_API void ecs_snapshot_free (ecs_snapshot_t *snapshot)
 Free snapshot resources.

Detailed Description

Snapshot addon.

A snapshot records the state of a world in a way so that it can be restored later. Snapshots work with POD components and non-POD components, provided that the appropriate lifecycle actions are registered for non-POD components.

A snapshot is tightly coupled to a world. It is not possible to restore a snapshot from world A into world B.

Definition in file snapshot.h.