Skip to content

Commit

Permalink
create own instance of GameManager
Browse files Browse the repository at this point in the history
  • Loading branch information
xXUnique31Xx committed Jul 1, 2024
1 parent dfd1297 commit c1a13b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions player.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from view import GameView
from algorithm import GameAI
from controller import GameManager


class Player():
Expand All @@ -17,7 +18,7 @@ class HumanPlayer(Player):
def __init__(self, color, view):
super().__init__(color)
self.view = view
self.game_manager = view.game_manager
self.game_manager = GameManager(view)

def make_move(self, start_pos, goal_pos, board, update=True):
"""Method to make a move."""
Expand All @@ -43,7 +44,7 @@ def __init__(self, color, board, view, enemy):
self.is_currently_playing = False
self.game_ai = GameAI(board, view, color, enemy)
self.view = view
self.game_manager = view.game_manager
self.game_manager = GameManager(view)

def make_move(self, board, update=True):
"""Method to make a move."""
Expand Down

0 comments on commit c1a13b3

Please sign in to comment.