Logic in Entity Components Systems

Posted by aaron on Game Development See other posts from Game Development or by aaron
Published on 2012-10-23T03:47:16Z Indexed on 2012/10/24 17:15 UTC
Read the original article Hit count: 311

I'm making a game that uses an Entity/Component architecture basically a port of Artemis's framework to c++,the problem arises when I try to make a PlayerControllerComponent, my original idea was this.

class PlayerControllerComponent: Component {
public:
    virtual void update() = 0;
}; 

class FpsPlayerControllerComponent: PlayerControllerComponent {
public:
    void update() {
        //handle input
    }
};

and have a system that updates PlayerControllerComponents, but I found out that the artemis framework does not look at sub-classes the way I thought it would. So all in all my question here is should I make the framework aware of subclasses or should I add a new Component like object that is used for logic.

© Game Development or respective owner

Related posts about component-based

Related posts about entity-system