Luo

From OpenEUO
Revision as of 00:44, 2 November 2010 by Ximan (Talk | contribs) (Live UO Methods)

Jump to: navigation, search

Calling Convention

Call

local l = sl.luo

Args

n/a

Result

l is a table with all live uo methods

Example Usage

local l = sl.luo
local waitforchange = function(old, live)
  while old == live() then
    wait(100)
  end
end
waitforchange(UO.Sex, l.Sex)
print('Something's very wrong!')

Description

luo stands for 'live uo' table, it provides functors that, when called, access the underlying values from the UO table. Thus it provides a tool to pass a UO table variable name to a function and have the value retrieved at a later point in execution.

While similar functionality can be obtain by passing around strings, the live uo methods have the advantage of being of type 'function' and passing argument checks where functions are expected. Misspelled method names raise an immediate error where specified. Thus, no special string processing/checking needs to be implemented.

Live UO Methods

There is a method for each corresponding name in the UO table. Additionally, the following methods return tables of related UO values with a single call:

See Also