1
0
Fork 0
fgdata/Nasal/canvas/gui/Config.nas

27 lines
377 B
Text
Raw Normal View History

2014-03-19 22:20:09 +00:00
var Config = {
new: func(cfg)
{
var m = {
parents: [Config],
_cfg: cfg
};
if( typeof(m._cfg) != "hash" )
m._cfg = {};
return m;
},
get: func(key, default = nil)
{
var val = me._cfg[key];
if( val != nil )
return val;
return default;
},
set: func(key, value)
{
me._cfg[key] = value;
return me;
2014-03-19 22:20:09 +00:00
}
};