Streamlined library and reworked the way runtime components work
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user