The term “Factories” comes from the factory design pattern. Factories are objects which can create new instances of certain types of Entities. Factories have two main benefits:
- They can be automatically associated with a PositionedObjectList so when you instantiate an object you don’t have to manually add it to a PositionedObjectList.
- They can pool Entities which can greatly reduce allocated memory for Entities which are created and destroyed frequently.