Strategická: Invert nefungovalo

This commit is contained in:
David Klement 2022-09-20 17:43:59 +02:00
parent f98a172f9d
commit 5d84156313

View file

@ -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()