diff --git a/actors/enums.py b/actors/enums.py index 80d5945..4b86c41 100644 --- a/actors/enums.py +++ b/actors/enums.py @@ -32,4 +32,19 @@ class GhostColor(Enum): class GhostMode(Enum): SCATTER = auto() CHASE = auto() - FRIGHTENED = auto() \ No newline at end of file + FRIGHTENED = auto() + +class GhostBehavior(Enum): + BLINKY = "blinky_behavior" + PINKY = "pinky_behavior" + INKY = "inky_behavior" + CLYDE = "clyde_behavior" + + def decide_direction(self, ghost, pacman, maze): + strategy = { + GhostBehavior.BLINKY: blinky_behavior, + GhostBehavior.PINKY: pinky_behavior, + GhostBehavior.INKY: inky_behavior, + GhostBehavior.CLYDE: clyde_behavior, + }[self] + return strategy(ghost, pacman, maze) \ No newline at end of file