Logic in Entity Components Sytems

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/23 5:28 UTC
Read the original article Hit count: 205

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