I'm sure that there is a design pattern solution to my problem, but I can't seem to decide what a workable approach is. I know what I want, I'm just having trouble making the connections... I'll explain:
I'm working on a game. I have GameObjects. I have GameBehaviors. The properties of my GameObjects are defined in an XML file which has all of the details.
<type name="Object">
<unit name="follower" behavior="followMouse" >
...other unit info here...
</unit>
</type>
So as a gameObject is instantiated, based on the value of the behavior property in the XML, it somehow has the behavior attached to it. I need the behavior to be able to access all of the properties of it's parent, such that it can say move the object around and what not...
I don't have a lot of experience with design patterns... and a number of them seem like they're almost right but none of the examples that I've read seem to make it click for me.
I'm working with AS3, but feel free to make it bit more general.