add Observer and Command

This commit is contained in:
4eker 2026-05-23 00:24:16 +03:00
parent 29495a0eda
commit 056c905032
4 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
from Command import Command
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