|
| 06 Jan 2014 07:43 PM |
Hey guys, obviously from the title I am in need of help with metatables and methods. My overall project is to make an extensible command structure but I need to learn how to properly use metatables for lookup on indexes. I am quite desperate in help and any information would be greatly appreciated!
Thanks |
|
|
| Report Abuse |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Jan 2014 07:59 PM |
setmetatable to set a metatable to a table getmetatable to get a metatable of a table metatables can have metatables rawget gets from a table without invoking metamethods rawset sets a key in a table without invoking metamethods rawequal compares a table to something without invoking metamethods
__index invoked when table[key] is nil __newindex invoked when table[key] is nil __call invoked when table(arguments) __add, __sub, __mul, __div, __mod, __unm are invoked when +-*/%-ing a table etc |
|
|
| Report Abuse |
|