Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
Engine::ComponentReflection Struct Reference

Reflection metadata and ECS callbacks for a component. More...

#include <ComponentReflection.hpp>

Public Attributes

std::string name
 Internal component name (derived from type, e.g. "SpriteRenderer").
std::string category = "General"
 Top-level menu group shown in "Add Component" (e.g. "Rendering & Lights").
std::string displayName
 Human-readable label inside the category submenu (e.g. "Sprite Renderer"). If empty the editor derives it from name.
std::vector< ComponentField > fields
std::function< void(Registry &, Entity)> add
std::function< bool(Registry &, Entity)> has
std::function< void(Registry &, Entity)> remove
std::function< void *(Registry &, Entity)> get

Detailed Description

Reflection metadata and ECS callbacks for a component.

The menuPath field drives the "Add Component" popup hierarchy. It is in the form "Category/Display Name" — for example: "Rendering & Lights/Sprite Renderer" If displayName is empty the editor derives one from name at render time.

Member Data Documentation

◆ add

std::function<void(Registry&, Entity)> Engine::ComponentReflection::add

◆ category

std::string Engine::ComponentReflection::category = "General"

Top-level menu group shown in "Add Component" (e.g. "Rendering & Lights").

◆ displayName

std::string Engine::ComponentReflection::displayName

Human-readable label inside the category submenu (e.g. "Sprite Renderer"). If empty the editor derives it from name.

◆ fields

std::vector<ComponentField> Engine::ComponentReflection::fields

◆ get

std::function<void*(Registry&, Entity)> Engine::ComponentReflection::get

◆ has

std::function<bool(Registry&, Entity)> Engine::ComponentReflection::has

◆ name

std::string Engine::ComponentReflection::name

Internal component name (derived from type, e.g. "SpriteRenderer").

◆ remove

std::function<void(Registry&, Entity)> Engine::ComponentReflection::remove

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