I'm using the Artemis-odb framework for coding game in Java (https://github.com/junkdog/artemis-odb).
I would like to instantiate some Entity (for example, buildings and people/workers). I've also seen the EntityManager class of the framework and tried to use it.
Here is my problem :
- I don't want to have a huge class extending EntityManager and having all the "create" methods because it will be an awful class --> too much lines of code, no lisibility, no thanks.
- I tried to create mutliple classes extending EntityManager, but then, each has its "nextId" value (it enables to know the id to give to the new Entity) --> I obtain mutliple entities with the same id.
- If I create multiple classes and reference only one EntityManager, I can't access to the create method of the EntityManager because this method is protected.
- An other solution I tried was to create different classes with only static methods and referencing an EntityManager. But my EntityManagers need to have non-static methods due to another reason (I spare the details).
Do you have any viable solution? There is not so much documentation for now about this framework so it's a bit complicated!
Thanks,