Open source Star Ruler 2 source code!
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
final class ConVar : ConsoleCommand {
|
||||
string name;
|
||||
double value;
|
||||
|
||||
ConVar(const string& Name, double initial = 0) {
|
||||
name = Name;
|
||||
value = initial;
|
||||
addConsoleCommand(Name, this);
|
||||
}
|
||||
|
||||
void execute(const string& args) {
|
||||
if(args.length != 0)
|
||||
value = toDouble(args);
|
||||
print(name + " = " + value);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user