mitiru::ecs
Lightweight entity-component-system used by the engine's runtime scenes and gameplay code.
Lightweight entity-component-system used by the engine's runtime scenes and gameplay code.
| Name | Kind | Items |
|---|---|---|
ComponentRegistry | class | 7 |
BenchmarkResult | struct | 8 |
BenchmarkConfig | struct | 4 |
ECSBenchmark | class | 10 |
EnttWorld | class | 11 |
CommonTag | enum | 9 |
MitiruWorld | class | 14 |
PrefabComponent | struct | 2 |
Prefab | struct | 2 |
PrefabLibrary | class | 8 |
SystemEntry | struct | 3 |
SystemScheduler | class | 7 |
Free functions and typedefs
using ComponentSerializer = std::function<std::string(const void*)>;class ComponentRegistry 7
template <typename T> void registerType(std::string name, ComponentSerializer serializer)[[nodiscard]] std::string serialize(sgc::TypeIdValue typeId, const void* data) const[[nodiscard]] std::vector<std::string> registeredNames() consttemplate <typename T> [[nodiscard]] bool isRegistered() const[[nodiscard]] std::size_t size() const noexcept[[nodiscard]] std::string toJson() constusing BenchmarkFunc = std::function<void()>;struct BenchmarkResult 8
std::string namedouble totalMs = 0.0double averageMs = 0.0double minMs = 0.0double maxMs = 0.0std::uint64_t entityCount = 0std::uint64_t iterations = 0double entitiesPerSecond = 0.0struct BenchmarkConfig 4
int warmupIterations = 5int measureIterations = 100int entityCount = 10000bool verbose = falseclass ECSBenchmark 10
ECSBenchmark() = default~ECSBenchmark() = defaultECSBenchmark(const ECSBenchmark&) = deleteECSBenchmark& operator=(const ECSBenchmark&) = deleteECSBenchmark(ECSBenchmark&&) noexcept = defaultECSBenchmark& operator=(ECSBenchmark&&) noexcept = defaultvoid configure(const BenchmarkConfig& config)void addBenchmark(const std::string& name, std::uint64_t entityCount, BenchmarkFunc func)[[nodiscard]] std::vector<BenchmarkResult> runAll()[[nodiscard]] static std::string formatReport( const std::vector<BenchmarkResult>& results)class EnttWorld 11
using Entity = entt::entity;[[nodiscard]] Entity createEntity(const std::string& name = "")void destroyEntity(Entity entity)template<typename T, typename... Args> T& addComponent(Entity entity, Args&&... args)template<typename T> T* getComponent(Entity entity)template<typename T> bool hasComponent(Entity entity) consttemplate<typename... Components> auto view()[[nodiscard]] std::size_t entityCount() const noexcept[[nodiscard]] entt::registry& registry() noexcept[[nodiscard]] const entt::registry& registry() const noexcept[[nodiscard]] std::string entityName(Entity entity) constenum CommonTag : std::uint8_t 9
PlayerEnemyPlatformCollectibleUICameraTriggerCountusing CommonTagSet = std::bitset<static_cast<std::size_t>(CommonTag::Count)>;class MitiruWorld 14
[[nodiscard]] sgc::ecs::World& world() noexcept[[nodiscard]] const sgc::ecs::World& world() const noexceptvoid addCommonTag(sgc::ecs::Entity entity, CommonTag tag)void removeCommonTag(sgc::ecs::Entity entity, CommonTag tag)[[nodiscard]] bool hasCommonTag(sgc::ecs::Entity entity, CommonTag tag) const[[nodiscard]] CommonTagSet getCommonTags(sgc::ecs::Entity entity) constvoid setTag(sgc::ecs::Entity entity, std::string tag)[[nodiscard]] std::string getTag(sgc::ecs::Entity entity) constvoid addLabel(sgc::ecs::Entity entity, const std::string& label)[[nodiscard]] bool hasLabel(sgc::ecs::Entity entity, const std::string& label) constvoid removeLabel(sgc::ecs::Entity entity, const std::string& label)[[nodiscard]] std::size_t entityCount() const noexcept[[nodiscard]] std::string snapshot() constvoid destroyEntity(sgc::ecs::Entity entity)struct PrefabComponent 2
std::string namestd::string jsonDatastruct Prefab 2
std::string namestd::vector<PrefabComponent> componentsclass PrefabLibrary 8
void add(Prefab prefab)[[nodiscard]] std::optional<Prefab> get(const std::string& name) const[[nodiscard]] bool has(const std::string& name) constvoid remove(const std::string& name)[[nodiscard]] std::vector<std::string> listNames() const[[nodiscard]] static std::string toJson(const Prefab& prefab)[[nodiscard]] static Prefab fromJson(const std::string& jsonStr)[[nodiscard]] std::size_t size() const noexceptstruct SystemEntry 3
std::string nameint priority = 0std::function<void(float)> updateFnclass SystemScheduler 7
void addSystem(SystemEntry entry)void removeSystem(const std::string& name)void update(float dt)[[nodiscard]] std::vector<std::string> systemNames() const[[nodiscard]] std::string toJson() const[[nodiscard]] std::size_t size() const noexceptvoid clear() noexceptSourced from docs/API_CATALOG.md, auto-generated by tools/generate_api_catalog.py.