


It wasn't working either, so I thought maybe it had something to do with right/left-hand issues with the language. At first, I was doing this: 'world.get_component(0)->position = Vector2D(4.4, 3.3) ' to change the value. Any reason why it isn't? My C++ is a little rusty. In the Physics_System function, I would expect the value to be updated. My_world.get_component(0)->position.print() While (1) // Detect window close button or ESC key #include "./ECS/components/Position_comp.hpp"Ĭlass ComponentStorage : public VComponentStorage However, when I try to save new data to the element in the vector using a pointer dereference (see Physics_System below), the new values aren't saved. I can store new data just fine (it eventually prints out if I do so). Nothing special.Īs a starting point, internally the storage class for each component type has its own vector. In the example, it contains a Vector2D object. To do so, I have an ECS_Manager Class, which uses templates to have multiple storage classes for each data type I'd like to use as a component.Įach component is just a struct with an int and whatever else data I'd like. I am trying to make a toy Entity Component System to improve on my C++ skills.
