legatt 32f4597c4d Base frontend module
- Naming style migrated to camel-case
- P7lib logger sources added
- Vcpkg manifest, CMake presets and build moved to root
- SDL2, Vulkan and RmlUi dependencies added
- Logger LOG macro added
- Logger  configuration
- SDL2 window configuration
- Vulkan configuration
- RmlUi configuration
- SDL event loop
2025-08-08 00:07:32 +03:00

45 lines
969 B
C++

#include "ee_ecs/world.hpp"
#include <ee_ecs/ecs.hpp>
static ee_ecs::World worldInstance;
void ee_ecs::init(ee_ecs::InitConfiguration config)
{
for (auto& [id, container]: config.states)
{
worldInstance.registerState(id, container);
}
}
void ee_ecs::start()
{
while (true) {}
}
template<typename T>
const std::vector<ee_ecs::EnterpriseInfo> ee_ecs::getAllEnterprises()
{
std::vector<EnterpriseInfo> result;
//TODO: REPLACE VIEWS WITH GROUPS!
auto enterprises = worldInstance.getRegistry().group<>(entt::get<
ee_economy::Enterprise,
ee_economy::Container,
T
>);
result.reserve(enterprises.size_hint());
for (auto [entity, enterprise, container, action]: enterprises.each())
{
EnterpriseInfo eninfo;
eninfo.info = &enterprise;
eninfo.storage = &container;
eninfo.specialInfo = &action;
result.push_back(eninfo);
}
return result;
}