Skip to main content
Typo
Link
Martin Sojka
  • 5.7k
  • 32
  • 30

Logic in Entity Components SytemsSystems

Tweeted twitter.com/#!/StackGameDev/status/260623195965644800
Source Link
aaron
  • 61
  • 1
  • 4

Logic in Entity Components Sytems

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.