Answer the question
In order to leave comments, you need to log in
Entity Component System + OOP approach?
It is not entirely clear how to write in this style, whether it is possible to interfere with OOP. For example, there is an entity player with a set of components inherited from Entity, it has methods that change data in components, these methods are called in systems. Or there is no type of "types" of entities and it is necessary to take components from entity only in systems and only do something there. About states, add empty components to remove in entity as flags that the entity is in any state, and separate systems for processing each state is this a normal approach ?! *
Answer the question
In order to leave comments, you need to log in
ECS is not only a decomposition approach for logic and data, but also an approach to reject aggregation and inheritance in favor of indirect composition. Explicit composition in ECS is also not provided, and indirect composition does not hint at the connectivity or structure of the data. Indirect composition means only the presence of any data on some indirect features.
Moreover, within the framework of ECS, third-party code is not able to work normally with data. For third-party code, ECS provides an abstraction layer for reading and writing data.
All this should indicate that OOP can only be used next to ECS and separately from ECS, but not together with and not inside the ECS data model.
For example, there is an entity player with a set of components inherited from Entity,
About states, add empty components to remove in entity as flags that the entity is in any state, and separate systems for processing each state is this a normal approach ?!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question