What is your aversion to the use of pointers? Type instances are pointers, anyway.
The way you're doing it is the way I do it in my own code. In my board game engine, every object has a Parent and a Child of the "Object" type. I simply set the parent or child of each object and then cast it back when I need it. For instance:
Of course, if the Parent or Child will always be a specific Type, you can skip the casting and just have GetChild()/GetParent() return that type instead of an Object.
Exactly why is it you don't like using this method?
SpaceAce
The way you're doing it is the way I do it in my own code. In my board game engine, every object has a Parent and a Child of the "Object" type. I simply set the parent or child of each object and then cast it back when I need it. For instance:
ObjectA:FirstType = New FirstType ObjectB:SecondType = New SecondType ObjectA.SetChild(ObjectB) ObjectB.SetParent(ObjectA) SecondType(ObjectA.GetChild()).SomeMethodFromSecondType()
Of course, if the Parent or Child will always be a specific Type, you can skip the casting and just have GetChild()/GetParent() return that type instead of an Object.
Exactly why is it you don't like using this method?
SpaceAce