new highscore system
This commit is contained in:
@@ -28,6 +28,16 @@ class CoolUtil
|
||||
return v == null ? defaultValue : v;
|
||||
}
|
||||
|
||||
public static function setFieldDefault<T>(v:Dynamic, name:String, defaultValue:T):T {
|
||||
if (Reflect.hasField(v, name)) {
|
||||
var f = Reflect.field(v, name);
|
||||
if (f != null && Std.isOfType(f, T))
|
||||
return cast f;
|
||||
}
|
||||
Reflect.setField(v, name, defaultValue);
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public static function addZeros(str:String, num:Int) {
|
||||
while(str.length < num) str = '0${str}';
|
||||
return str;
|
||||
@@ -130,11 +140,6 @@ class CoolUtil
|
||||
}), volume);
|
||||
}
|
||||
|
||||
public static function difficultyString():String
|
||||
{
|
||||
return difficultyArray[PlayState.storyDifficulty];
|
||||
}
|
||||
|
||||
public static function coolTextFile(path:String):Array<String>
|
||||
{
|
||||
return [for(e in Assets.getText(path).trim().split('\n')) e.trim()];
|
||||
|
||||
Reference in New Issue
Block a user