diff --git a/klient/play.py b/klient/play.py index 4c68f0c..0fef742 100755 --- a/klient/play.py +++ b/klient/play.py @@ -14,16 +14,15 @@ class Action(enum.Enum): RIGHT = enum.auto() STAY = enum.auto() - _inversions = { - UP: DOWN, - DOWN: UP, - LEFT: RIGHT, - RIGHT: LEFT, - STAY: STAY, - } - def invert(self) -> Action: - return self._inversions[self] + INVERSIONS = { + Action.UP: Action.DOWN, + Action.DOWN: Action.UP, + Action.LEFT: Action.RIGHT, + Action.RIGHT: Action.LEFT, + Action.STAY: Action.STAY, + } + return INVERSIONS[self] def __str__(self) -> str: return self.name.lower()