Often times entities are part of a higher level class used in our applications. (GameObject) Currently there is no easy way to obtain a GameObject from a MovableObject. What we need is a simple member:
We could either have this be public and directly accessible, or add get/set functions to wrap it. This is very easy to add in, and does not force us to name our MovableObject instance to match the name of our GameObject. In fact, if you have 2 MovableObjects with the same name you will get an exception.
Often times entities are part of a higher level class used in our applications. (GameObject) Currently there is no easy way to obtain a GameObject from a MovableObject. What we need is a simple member:
We could either have this be public and directly accessible, or add get/set functions to wrap it. This is very easy to add in, and does not force us to name our MovableObject instance to match the name of our GameObject. In fact, if you have 2 MovableObjects with the same name you will get an exception.
You don't even need to derive anymore. The Any object is a templated wrapper around any type, so you can store whatever you want. It's basically a save variant to a void* pointer.