[common] add dota levels
This commit is contained in:
@@ -98,10 +98,10 @@ typedef GamePreset = {
|
||||
|
||||
typedef LevelConfig = {
|
||||
var data:Array<BrickConfig>;
|
||||
@:optional var name:String;
|
||||
@:optional var points:Array<SpawnPoint>;
|
||||
}
|
||||
|
||||
|
||||
class Config {
|
||||
public var type(default, null):String;
|
||||
public var game(default, null):GameConfig;
|
||||
|
||||
@@ -5,9 +5,9 @@ import yaml.Parser;
|
||||
import yaml.Renderer;
|
||||
import yaml.Yaml;
|
||||
|
||||
|
||||
typedef LevelSource = {
|
||||
var data:String;
|
||||
@:optional var name:String;
|
||||
@:optional var points:Array<SpawnPoint>;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ class LevelUtil {
|
||||
return {
|
||||
data: obj.data.split('').map(function(c) return config.getBrickByIndex(Std.parseInt(c))),
|
||||
points: obj.points,
|
||||
name: obj.name,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,6 +51,7 @@ class LevelUtil {
|
||||
return Yaml.render({
|
||||
data: bricksStr,
|
||||
points: level.points,
|
||||
name: level.name,
|
||||
}, Renderer.options().setFlowLevel(1));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user