16 throw std::runtime_error(
"World not initialized");
20 }
catch (
const std::exception &e) {
21 LOG_ERROR(
"Failed to create entity: " + std::string(e.what()));
38 }
catch (
const std::exception &e) {
39 LOG_ERROR(
"Failed to destroy entity: " + std::string(e.what()));
44 lua.set_function(
"log", [](
const std::string &message) {
LOG_DEBUG(
"[LUA] " + message); });
47 lua.set_function(
"entityExists", [world](
ecs::Address addr) ->
bool {
55 }
catch (
const std::exception &e) {
56 LOG_ERROR(
"Error checking entity existence: " + std::string(e.what()));
High-level ECS manager providing clean server-side API.
Entity createEntity()
Create a new entity.
Entity getEntity(Address address)
Get an entity wrapper from an address.
void destroyEntity(const Entity &entity)
Destroy an entity and remove it from the world.
High-level entity wrapper providing fluent interface.
bool isValid() const
Check if this entity is valid.
std::uint32_t Address
Type used to represent an entity address/ID.
void bindWorld(sol::state &lua, ecs::wrapper::ECSWorld *world)
Bind ECS world operations to Lua.