Namespace VS class instance

Nov 16, 2014 at 1:28am
Ok so I'm making an ECS model... was just thinking about the Managers, obviously you'll have an EntityManager and a SystemManager, but your only going to have 1 of each. Now I personally don't care for Singletons even though my dad's last name is Singleton (though that could be why... :) ), and a static class would just be silly, so would it be best to create an instance of each in the main game loop, or to simply set them up as Namespaces?

Obviously the EntityManager is going to have a vector of Entities and some functions that affect this vector by adding and removing entities, likewise, the SystemManager will have a vector of systems and functions that operate over it. So what would be the better course?
Nov 16, 2014 at 2:14am
What do you expect your 'manager' classes to do? The manager pattern means different things to different people and can be used in many different ways.
Nov 16, 2014 at 5:20am
Exactly as I stated, they will have vectors of unique pointers to entities and systems, they will handle the adding and removing of said elements to the vectors. That's about it, aside from the odd ball variable like the entity id.
Last edited on Nov 16, 2014 at 5:20am
Nov 16, 2014 at 5:41am
OK, now how will you use them? It sounds like you're making some kind of garbage collector, but I could be wrong.
Topic archived. No new replies allowed.