function Module(rune)
{
this.rune = rune;
this.element = null;
this.parameters = [];
this.variables = {};
this.docs = "Missing documentation.";
this.active = function(cmd)
{
console.log("Nothing to do.");
}
this.passive = function(cmd)
{
console.log("Nothing to do.");
}
this.update_variables = function(cmd)
{
for (var key in this.variables){
if(!cmd.variable(key)){ continue; }
this.variables[key] = cmd.variable(key).value;
}
}
this.hint = function(cmd)
{
var s = this.pad(cmd.content.join(" "));
s += cmd.content.join(" ").length == 0 ? ""+this.constructor.name+"" : "";
// Params
var e = 0;
while(e < 10){
if(!this.parameters[e]){ break; }
var param_name = this.parameters[e].name;
s += cmd[param_name.toLowerCase()]() ? "" : ""+param_name+"";
e += 1;
}
// Variables
if(this.variables){
for (var key in this.variables){
if(cmd.variable(key)){continue;}
s += ""+key+"="+this.variables[key]+" ";
}
}
return s;
}
this.pad = function(input)
{
var s = "";
for (i = 0; i < input.length+2; i++){
s += "_";
}
return ""+s+"";
}
this.widget = function()
{
return "";
}
this.widget_cursor = function()
{
return "Missing";
}
this.mouse_down = function(position)
{
}
this.mouse_move = function(position)
{
}
this.mouse_up = function(position)
{
}
}