mocha-engine / mocha

Mocha: A work-in-progress 3D game engine
GNU Lesser General Public License v3.0
53 stars 7 forks source link

Entity relations #38

Open Weldify opened 1 year ago

Weldify commented 1 year ago

Adding a way for entities to have relations would make the engine a lot more flexible, so here's my idea:

Each entity should have a Parent property and a Children property. Setting the parent of entity A to entity B will add entity A to B's list of children.

This is really simple and scalable, LINQ will also make working with this really pleasant! Provided entities in this engine will be lightweight, even entity "components" don't have to exist as you can just easily make them yourself with this system!