apotapov / gdx-artemis

Fork of artemis entity-system (http://gamadu.com/artemis/) refactored to integrate with Libgdx (http://libgdx.badlogicgames.com/)
Other
53 stars 5 forks source link

Make Entity constructor package-protected #6

Closed spaceemotion closed 10 years ago

spaceemotion commented 11 years ago

The constructor of Entity is public, so I can theoretically still create entities through the constructor. Making it package-protected would force the "user" to create new entities through the world

apotapov commented 11 years ago

Sorry, been busy with a move. Sounds logical, I'll make the change. Feel free to submit a pull request as well. :)

apotapov commented 10 years ago

Doesn't look like this is going to work. Since I moved the EntityManager to the managers package. It needs the Entity constructor to be public. I don't think this is too bad though. Since creating and inserting entities manually will cause errors if you don't set the entity id correctly. Not sure if there's a better way to protect against this..