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
Registry.hpp File Reference
#include "EntityManager.hpp"
#include "ComponentStorage.hpp"
#include <unordered_map>
#include <typeindex>
#include <functional>
#include <vector>
#include <memory>
#include "core/EngineAPI.hpp"

Go to the source code of this file.

Classes

class  Registry
 Coordinates entities and components, providing creation, removal, lookup, and views. More...
class  Registry::View< Components >
 Zero-allocation filtered view over entities containing a specific set of components. More...
struct  Registry::View< Components >::Iterator
 Iterator over the entities matching the View filters. More...

Functions

ENGINE_API std::unordered_map< std::type_index, std::size_t > & g_componentTypeMap ()
 Retrieves the global map of component types to unique numeric IDs.
ENGINE_API std::size_t registerComponentType (std::type_index idx)
 Registers or retrieves the unique ID for a component type.

Function Documentation

◆ g_componentTypeMap()

ENGINE_API std::unordered_map< std::type_index, std::size_t > & g_componentTypeMap ( )

Retrieves the global map of component types to unique numeric IDs.

Returns
Reference to the type index map.

◆ registerComponentType()

ENGINE_API std::size_t registerComponentType ( std::type_index idx)

Registers or retrieves the unique ID for a component type.

Parameters
idxThe type index.
Returns
The unique ID of the component type.