The entity component system
The entity component system is a programming pattern, which allows entities to possess properties and functionality through the means of composition, as opposed to inheritance. The biggest benefits of using this pattern include stronger decoupling of logic, easier serialization and de-serialization of entities, better reusability of code and ease of creating new entities. It does, however, add a fair bit of complexity to your code base.
The typical implementation of this pattern consists of three parts:
Entities: In most cases, entities are barely anything more than identifiers, slapped on a collection of components
Components: These are the building blocks of entities, that are nothing more than collections of data
Systems: These are specialized classes that deal with a very specific task and are responsible for holding all of the logic in this paradigm
In addition to working with these three distinct types of elements, our entity component system is also going...