Without proper management, these entities are just random classes scattered about in your memory with no rhyme or reason. In order to produce a robust way to create interactions between entities, they need to be babysat by a manager class. Before we begin designing it, let's define some data types to contain the information we're going to be working with:
using EntityContainer = std::unordered_map<unsigned int,EntityBase*>; using EntityFactory = std::unordered_map<EntityType, std::function<EntityBase*(void)>>; using EnemyTypes = std::unordered_map<std::string,std::string>;
EntityContainer type is, as the name suggests, a container of entities. It is once again powered by an
unordered_map, which ties instances of ...