alecthomas / entityx

EntityX - A fast, type-safe C++ Entity-Component system
MIT License
2.22k stars 295 forks source link

is it possible to use interfaces/abstract base classes as components? #163

Closed greenmughal closed 7 years ago

greenmughal commented 7 years ago

Hi,

I want to create a cross game engines framework, i idea is that i will have an interface IGraphicsComponent etc and I will implement it for different Game Engines. Will EntityX support abstract base classes?

Thanks

greenmughal commented 7 years ago

Actually i found a few years old similar issue https://github.com/alecthomas/entityx/issues/42

I like the idea of normal components as mixins.

Will it work out? suppose i want to use a entityX for for all unreal, cryengine & ogre3d.

So I will have my common components like PlayerController, AI, PathPlanning but i want to use Unreal/CryEngine's built in Input, Physics & Graphics? How the communication will happen b/w these components?

alecthomas commented 7 years ago

There is no BaseComponent requirement anymore, so that issue is no longer relevant.

From what you're describing though, I would abstract those as Systems rather than Components. eg. InputSystem, PhysicsSystem, and so on.

greenmughal commented 7 years ago

Thanks man for confirming.