Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow mixins to be separated. #11

Open
flamendless opened this issue Jul 31, 2018 · 1 comment
Open

Allow mixins to be separated. #11

flamendless opened this issue Jul 31, 2018 · 1 comment

Comments

@flamendless
Copy link

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:

local Human = classic:extend()
local Power = classic:extend()
function Power:magic() end

Human:implement(Power)

function Human: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

@gingerbeardman
Copy link

what are the benefits of this proposition?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants