diff --git a/src/kernel/peripherals/Side.hx b/src/kernel/peripherals/Side.hx index bc4c6ee..ce8dabe 100644 --- a/src/kernel/peripherals/Side.hx +++ b/src/kernel/peripherals/Side.hx @@ -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; + } + } }