2026-rff_mp/pomelovsd/ExitMaze/Observer_Command/MoveCommand.py

15 lines
365 B
Python
Raw Normal View History

2026-05-23 10:37:43 +00:00
from .Command import Command
2026-05-22 21:24:16 +00:00
class MoveCommand(Command):
def __init__(self, player, target):
self.player = player
self.target = target
self.previous = None
def execute(self):
self.previous = self.player.current
self.player.current = self.target
def undo(self):
self.player.current = self.previous