User:Lil Toady: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
* Optimize destroyElement | * Optimize destroyElement | ||
* Release packets queue after function call | * Release packets queue after function call | ||
* Enhance timers (gc) | * Enhance files and timers (gc) | ||
===OOP Metatable Structure=== | ===OOP Metatable Structure=== |
Revision as of 19:50, 3 May 2013
TODO:
- OOP tostring
- Handle vectors in CLuaArgument
- Optimize destroyElement
- Release packets queue after function call
- Enhance files and timers (gc)
OOP Metatable Structure
-- Exposed to global environment Element = { create = createElement, setPosition = setElementPosition, ... } Vehicle = { create = createVehicle, setColor = setVehicleColor, ... } -- Hidden in lua registry, applied to userdata ElementMT = { __index = CLuaClassDefs::Index, __newindex = CLuaClassDefs::NewIndex, __class = Element, __set = { type = CLuaClassDefs::ReadOnly, health = setElementHealth, ... }, __get = { type = getElementType, health = getElementHealth, ... }, } VehicleMT = { __index = CLuaClassDefs::Index, __newindex = CLuaClassDefs::NewIndex, __class = Vehicle, __parent = ElementMT, __set = { damageProof = setVehicleDamageProof ... }, __get = { damageProof = isVehicleDamageProof ... }, }