[editor] added editor module
This commit is contained in:
@@ -13,10 +13,9 @@ class LevelBundle {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static function get(type:GameType, config:Config, level:Int):Array<BrickConfig> {
|
||||
var bricksData:String = Assets.getText('resources/${type}/levels/level${formatLevel(level)}.txt');
|
||||
public static function parse(config:Config, data:String):Array<BrickConfig> {
|
||||
var bricks:Array<BrickConfig> = [];
|
||||
for (line in ~/\s+/g.split(bricksData)) {
|
||||
for (line in ~/\s+/g.split(data)) {
|
||||
for (c in line.split('')) {
|
||||
if (c.length > 0) {
|
||||
bricks.push(config.bricks[Std.parseInt(c) + 1]);
|
||||
@@ -25,4 +24,9 @@ class LevelBundle {
|
||||
}
|
||||
return bricks;
|
||||
}
|
||||
|
||||
public static function get(type:GameType, config:Config, level:Int):Array<BrickConfig> {
|
||||
var data:String = Assets.getText('resources/${type}/levels/level${formatLevel(level)}.txt');
|
||||
return parse(config, data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user