Question

I'm currently re-designing my Entity System, for C++, and I have a lot of Managers. In my design, I have these classes, in order to tie my library together. I've heard a lot of bad things when it comes to "manager" classes, perhaps I'm not naming my classes appropriately. However, I have no idea what else to name them.

Most of the managers, in my library, are composed of these classes (although it does vary a little bit):

  • Container - a container for objects in the manager
  • Attributes - attributes for the objects in the manager

In my new design for my library, I have these specific classes, in order to tie my library together.

  • ComponentManager - manages components in the Entity System

    • ComponentContainer
    • ComponentAttributes
    • Scene* - a reference to a Scene (see below)
  • SystemManager - manages systems in the Entity System

    • SystemContainer
    • Scene* - a reference to a Scene (see below)
  • EntityManager - manages entities in the Entity System

    • EntityPool - a pool of entities
    • EntityAttributes - attributes of an entity (this will only be accessible to ComponentContainer and System classes)
    • Scene* - a reference to a Scene (see below)
  • Scene - ties all the managers together

    • ComponentManager
    • SystemManager
    • EntityManager

I was thinking of just putting all the container/pools in the Scene class itself.

i.e.

Instead of this:

Scene scene; // create a Scene

// NOTE:
// I technically could wrap this line in a createEntity() call in the Scene class
Entity entity = scene.getEntityManager().getPool().create();

It would be this:

Scene scene; // create a Scene

Entity entity = scene.getEntityPool().create();

But, I am unsure. If I were to do the latter, that would mean I would have a lot of objects and methods declared inside my Scene class.

NOTES:

  1. An entity system is simply a design that is used for games. It is composed of 3 major parts: components, entities, and systems. The components are simply data, which may be "added" to the entities, in order for the entities to be distinctive. An entity is represented by an integer. Systems contain the logic for an entity, with specific components.
  2. The reason I'm changing my design for my library, is because I think it can be changed quite a lot, I don't like the feel/flow to it, at the moment.

No correct solution

Licensed under: CC-BY-SA with attribution
scroll top