Lastly i have been reading articles about component based entity system checking what other people have already done and experienced.
While the main logic (if i did not misunderstand) is creating component classes which are inheriting an abstract base component class. Also entity classes inheriting the abstract Entity class and the components' classes they need.
But some people recommends that instead of creating entities with inheritance, they advice creating an entity manager class which creates, adds and removes components and such without using inheritance. They say this way is much cleaner and easy to use.
What do you think about the advice? Thinking it will written in C++, would it be more efficient and easy?
But some people recommends that instead of creating entities with inheritance, they advice creating an entity manager class which creates, adds and removes components and such without using inheritance.
This is a well discussed issue. Using UML speak, what you call inheritance is called generalization, and what you call without using inheritance is called aggregation.
I suggest you search "generalization vs aggregation" to see what has been said before.
It seems what i am going to use is composition but isn't both inheriting and adding it via function to an entity is called "composition". Since both does not owns components(you do not destroy component class when neither you removed inheritance nor removed added component).
My question was which method of adding a component to choose? Inheritance or via Entity manager is better?
Sorry if i misunderstood anything and thanks for the answer in advance.
Well, thanks for the answer @kbw. It seems even a three hours research did not help me much.
Though i do not fully understand which is called what, however i started to understand how to implement one and i guess i will choose to make an Entity Manager.