You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I think that mixins are also useful for acting as a sub-class that can be shared between multiple classes instead of making another base class. With that level of abstraction, i think that implemented mixins should have their own container.
Here's a snippet:
localHuman=classic:extend()
localPower=classic:extend()
functionPower:magic() endHuman:implement(Power)
functionHuman:cast()
--instead of Human:magic()
--i suggest:Human.Power:magic()
end
Also, Power class should have it's own self table.
To access the Human class from Power: self.parent.human_name
The text was updated successfully, but these errors were encountered:
Hi, I think that mixins are also useful for acting as a sub-class that can be shared between multiple classes instead of making another base class. With that level of abstraction, i think that implemented mixins should have their own container.
Here's a snippet:
Also, Power class should have it's own
self
table.To access the Human class from Power:
self.parent.human_name
The text was updated successfully, but these errors were encountered: