1
Feature requests / Re: Aggregating Drawable and Transformable for Polymorphic behavior
« on: May 26, 2014, 07:42:30 pm »
Yes, absolutely, I'm gonna need to add a new layer of abstraction, but given the nature of the ECS (Entity-Component-System) approach, this will be a rather unconventional layer.
This class will be part of the Graphics component. I an ECS framework, it's wise to keep components as close to being POD (plain old data) as possible. Certainly, I am going to need to implement inner methods that manage the duality of the Drawable/Transformable object inside the component, but all of this should be invisible to the rest of the engine.
That is, I should be able to do both
Calls like
An update method won't be necessary, for all of the logic is managed elsewhere.
This class will be part of the Graphics component. I an ECS framework, it's wise to keep components as close to being POD (plain old data) as possible. Certainly, I am going to need to implement inner methods that manage the duality of the Drawable/Transformable object inside the component, but all of this should be invisible to the rest of the engine.
That is, I should be able to do both
sf::Sprite s; graphicsComponent.node = &s;
andsf::Shape s; graphicsComponent.node = &s;
Calls like
graphicsComponent.node.setPosition(x,y) = &s;
might be unavoidable, but I can live with that.An update method won't be necessary, for all of the logic is managed elsewhere.