-- liu.lua
-- Common Lua Function
-- Author: Liu Denghong
-- Date: 20080630
liu = liu or {version='0.1';};
-- Examp: liu.Apply(liu, {a=1,b=2});
liu.Apply = function(o, c, defaults)
if defaults then
liu.Apply(o, defaults);
end
if (o and c and type(c)=="table") then
for p,v in pairs(c) do
o[p] = v;
end
end
end
liu.Apply(liu, {
EmptyFn = function() end;
Num = function(v, defaultValue)
if(type(v) ~= "number") then
return defaultValue;
end
return v;
end;
});