Strategická: Invert nefungovalo
This commit is contained in:
parent
f98a172f9d
commit
5d84156313
1 changed files with 8 additions and 9 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue