This may be getting into the multiple receivers feature, but I'm wondering if there's a way to do this without having to wrap the IComponent in a with() call or something similar.
The goal here being that I'm enforcing all the properties of the IComponent to only be accessed and modified within the context of a GUIUpdate.
1 year ago
The only way to do it rn, is to declare
var IComponent.description: String
(also, might be better to call it GuiUpdate)
Which probably isnt a maintanable model, as GuiUpdate will get bloatedCurrently, Kotlin differs between "implicit" (this) and "explicit" (stuff before
) recievers - and if you specify explicit reciever, then it cannot mean an implicit one in definition - so the
can only call:
a) stuff without reciever defined in IComponent
b) stuff that has IComponent as explicit receiver in definitionAnd yes, this would most likely be easier with multiple recievers, as smth like