16 lines
334 B
Python
16 lines
334 B
Python
|
from enum import Enum
|
||
|
|
||
|
|
||
|
class ShipMode(Enum):
|
||
|
PUT = "PUT"
|
||
|
SHOOT = "SHOOT"
|
||
|
UNKNOWN = "UNKNOWN"
|
||
|
|
||
|
@staticmethod
|
||
|
def from_string(raw_value):
|
||
|
if raw_value:
|
||
|
value = raw_value.upper()
|
||
|
if value in ShipMode.__members__:
|
||
|
return ShipMode[value]
|
||
|
return ShipMode.UNKNOWN
|