From d927a096c079079d1907be91ec4401fa222e441a Mon Sep 17 00:00:00 2001 From: Rodrigo Delduca <46259+skhaz@users.noreply.github.com> Date: Sat, 18 Nov 2023 12:06:38 -0300 Subject: [PATCH] Work in progress --- src/entitymanager.cpp | 2 +- src/scriptengine.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/entitymanager.cpp b/src/entitymanager.cpp index 33364cd..49e8d66 100644 --- a/src/entitymanager.cpp +++ b/src/entitymanager.cpp @@ -28,7 +28,7 @@ std::shared_ptr entitymanager::spawn() { } const auto e = entity::create({buffer.begin(), buffer.end()}); - std::cout << "Spawned entity: " << e->id() << std::endl; + std::cout << "[entitymanager] spawn: " << e->id() << std::endl; _entities.emplace_back(e); return e; } diff --git a/src/scriptengine.cpp b/src/scriptengine.cpp index 5686db3..07b20f6 100644 --- a/src/scriptengine.cpp +++ b/src/scriptengine.cpp @@ -61,8 +61,9 @@ void scriptengine::run() { lua.new_usertype( "Entity", - "x", sol::property(&entity::get_x, &entity::set_x), - "y", sol::property(&entity::get_y, &entity::set_y), + "id", sol::property(&entity::id), + "x", sol::property(&entity::x, &entity::set_x), + "y", sol::property(&entity::y, &entity::set_y), "width", sol::property(&entity::width), "height", sol::property(&entity::height), "move", &entity::move,