added side fromString

This commit is contained in:
Djeeberjr 2023-01-27 14:34:06 +01:00
parent f6c0feda4b
commit 95a9ab63d0

View File

@ -7,4 +7,24 @@ enum abstract Side(String) to String {
var Right = "right";
var Front = "front";
var Back = "back";
@:from
static public function fromString(s: String) {
switch (s) {
case "top":
return Top;
case "bottom":
return Bottom;
case "left":
return Left;
case "right":
return Right;
case "front":
return Front;
case "back":
return Back;
default:
return null;
}
}
}