fix
This commit is contained in:
@@ -37,20 +37,19 @@ class LevelBundle {
|
||||
}
|
||||
|
||||
public static function loads(config:Config, data:String):LevelConfig {
|
||||
try {
|
||||
if (config.type == 'classic') {
|
||||
return loadsOld(config, data);
|
||||
} else {
|
||||
var obj:LevelSource = Yaml.parse(data, Parser.options().useObjects());
|
||||
return {
|
||||
data: obj.data.split('').map(function(c) return config.getBrick(Std.parseInt(c))),
|
||||
points: obj.points,
|
||||
}
|
||||
} catch (error:Dynamic) {
|
||||
L.w('LevelBundle', '${error}');
|
||||
return loadsOld(config, data);
|
||||
}
|
||||
}
|
||||
|
||||
public static function dumps(config:Config, level:LevelConfig):String {
|
||||
var bricksStr = level.data.map(function(brick:BrickConfig) return brick.type).join('');
|
||||
var bricksStr = level.data.map(function(brick:BrickConfig) return Std.string(brick.type)).join('');
|
||||
return Yaml.render({
|
||||
data: bricksStr,
|
||||
points: level.points,
|
||||
|
||||
Reference in New Issue
Block a user