Streamlined library and reworked the way runtime components work

This commit is contained in:
2020-05-12 02:06:10 +02:00
parent c794e4a5d2
commit de5af0a5aa
11 changed files with 424 additions and 359 deletions

View File

@@ -15,7 +15,7 @@ namespace generated {
);
component.set_function("new", sol::factories([](float _x, float _y) {
return std::make_pair(new Position(_x, _y), "Position");
return std::make_pair(ecs::ComponentID::id<Position>, new Position(_x, _y));
}));
lua.set_function("_internal_to_Position", [] (ecs::Component* component) {
@@ -33,7 +33,7 @@ namespace generated {
);
component.set_function("new", sol::factories([](float _x, float _y) {
return std::make_pair(new Velocity(_x, _y), "Velocity");
return std::make_pair(ecs::ComponentID::id<Velocity>, new Velocity(_x, _y));
}));
lua.set_function("_internal_to_Velocity", [] (ecs::Component* component) {
@@ -51,7 +51,7 @@ namespace generated {
);
component.set_function("new", sol::factories([](std::string _name) {
return std::make_pair(new Meta(_name), "Meta");
return std::make_pair(ecs::ComponentID::id<Meta>, new Meta(_name));
}));
lua.set_function("_internal_to_Meta", [] (ecs::Component* component) {