The object manager

The M5ObjectManager is a singleton class that is responsible for, among other things, loading archetypes and creating objects. There are a lot of members and methods in this class so looking at everything would take too long. In this section, we will only go over the methods specifically related to loading and creating an object from an Archetype file. Remember that since the class is a singleton, we have global access. For that reason, every member and method is static:

class M5ObjectManager { public:   static M5Object* CreateObject(M5ArcheTypes type);   static void AddArcheType(M5ArcheTypes type,                              const char* fileName);   static void RemoveArcheType(M5ArcheTypes type);        //Plus other methods  private:  typedef M5Factory<M5ComponentTypes, ...

Get Game Development Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.