package input2actions; /** * by Sylvio Sell - Rostock 2019 */ @:forward @:transitive abstract NestedArrayItem(Array) from Array to Array { public function new() { this = new Array(); } @:from public static function fromOther(a:T):NestedArrayItem { return [a]; } @:from public static function fromArrayNestedArrayItem(av:Array>):NestedArrayItem { var item = new NestedArrayItem(); for (v in av) { for (i in v) item.push(i); } return item; } @:from public static function fromArray(a:Array):NestedArrayItem { var item = new NestedArrayItem(); for (v in a) { item.push(v); } return item; } } @:forward abstract NestedArray(Array>) from Array> to Array> { public function new() { this = new Array>(); } @:to public function toArray():Array { var a = new Array(); for (item in this) for (v in item) a.push(cast v); return a; } }