ronin/scripts/units/setting.js
2017-05-24 09:55:12 -10:00

33 lines
447 B
JavaScript

function Setting(name,value)
{
Unit.call(this);
this.host = null;
this.name = name;
this.value = value;
this.render = function()
{
return "?";
}
this.update = function(value)
{
this.value = value;
}
this.to_f = function()
{
return parseFloat(this.value);
}
this.to_rect = function()
{
return new Rect(this.value);
}
this.to_pos = function()
{
return new Position(this.value);
}
}