This is a set of additions to middleclass.
middleclass-extras was made for middleclass 1.x and it’s not under development any more.
middleclass 2.x has some features that make it incompatible with middleclass-extras.
middleclass-extras is being (slowly) re-done as a series of smaller libs. Right now, the only one completely finished is Stateful:
Other libraries might follow, but it might just take time. Sorry about that.
What follows is a brief description of each of the middleclass-extras modules. Each nodule is commented out with usage examples. You can find more examples on the /spec/ folder.
addChild
, getAncestors
, etc)__index
metamethod. Since __index
is reserved, the method used for lookup will be index
, whithout underscores.addState
, and instances receive a new method called gotoState
. The behaviour of each of the instance methods can be redefined per-state.The recommended way is using git.
In order to use middleclass-extras, you also need middleclass. You can download them both by doing:
cd your/project/path
git clone git://github.com/kikito/middleclass.git
git clone git://github.com/kikito/middleclass-extras.git
Alternatively, you can manually download them:
middleclass-extras is prepared to be required right after middleclass:
require('middleclass.init') require('middleclass-extras.init')
Notes:
?/init.lua
You may find the specs for this library in middleclass-specs
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。