[config] config.yaml
This commit is contained in:
@@ -26,4 +26,14 @@ class Direction {
|
||||
public static function from(x:Int, y:Int):Direction {
|
||||
return directions.get(x + y * 10);
|
||||
}
|
||||
|
||||
@:from static public function fromString(s:String):Direction {
|
||||
return switch(s) {
|
||||
case 'left': LEFT;
|
||||
case 'top': TOP;
|
||||
case 'right': RIGHT;
|
||||
case 'bottom': BOTTOM;
|
||||
case _: null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user