Starting point

This commit is contained in:
Connor
2026-01-27 00:59:20 +09:00
commit 618b7bd257
10 changed files with 181 additions and 0 deletions

1
src/CMakeLists.txt Normal file
View File

@@ -0,0 +1 @@
add_subdirectory(core)

21
src/core/CMakeLists.txt Normal file
View File

@@ -0,0 +1,21 @@
# Factory Core library
add_library(factory_core STATIC
factory_core.cpp
)
# Add alias for consistent usage
add_library(factory::core ALIAS factory_core)
target_include_directories(factory_core
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(factory_core
PUBLIC
flecs::flecs_static
)
# Set compile features
target_compile_features(factory_core PUBLIC cxx_std_17)

View File

@@ -0,0 +1,5 @@
#include "factory_core.hpp"
// Implementation file for factory_core
// Currently empty as Core is header-only, but needed for static library target
// Future implementations will go here

25
src/core/factory_core.hpp Normal file
View File

@@ -0,0 +1,25 @@
#pragma once
#include <flecs.h>
namespace factory {
// Core engine class wrapping flecs world
class Core {
public:
Core() : world_() {}
// Access the underlying flecs world
flecs::world& world() { return world_; }
const flecs::world& world() const { return world_; }
// Progress the simulation by one tick
bool progress(float delta_time = 0.0f) {
return world_.progress(delta_time);
}
private:
flecs::world world_;
};
} // namespace factory