Clone wiki

Fairlight / Accessors


In Monkey there are no pointers. This makes it hard if a component needs to update the values of another one.

Because of this Fairlight introduces the concept of Accessors. An Accessor-Interface requires that the developer implements a getter and setter method. A good example is the Tweenable Interface that extends the FloatAccessor.

The Developer implements SetValue and GetValue. Those methods can be called from a Tween-Object and thus it can send updated values to the Tweenable-Object. In the Set/Get-Method the developer can route the new values to any value/object he'd like to.

Have a look at the (Tweener-Example) how this could look like.