Return to repo list

heart-of-gold

Tactical RPG written in python, using pygame.
Return to HMagellan.com

commit a9ca5eeeb51c09112db1f3ca40b65a0b5b35c409
parent 5fc83ae6e7c3048ea94d87c2fa975591c996c253
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Tue, 17 Nov 2020 11:52:18 -0600

managers should take camera as argument

Diffstat:
Msrc/board.py | 4++--
Msrc/game.py | 14+++++++-------
Msrc/images.py | 4++--
Msrc/manager.py | 3++-
Msrc/menu.py | 4++--
Msrc/piece.py | 4++--
Msrc/scene.py | 4++--
Msrc/sound.py | 4++--
Msrc/turn.py | 4++--
9 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/src/board.py b/src/board.py @@ -21,9 +21,9 @@ class BoardManager(manager.Manager): switching between Boards. """ - def __init__(self, game, bus, name): + def __init__(self, game, bus, camera, name): - super().__init__(game, bus, name) + super().__init__(game, bus, camera, name) # Board values self.current_board = None diff --git a/src/game.py b/src/game.py @@ -49,13 +49,13 @@ class Game(object): self.interface = interface.GameInterface(self, self.manager_bus, self.camera) # Managers - self.sheet_manager = images.SheetManager(self, self.manager_bus, "sheet_manager") - self.sound_manager = sound.SoundManager(self, self.manager_bus, "sound_manager") - self.menu_manager = menu.MenuManager(self, self.manager_bus, "menu_manager") - self.board_manager = board.BoardManager(self, self.manager_bus, "board_manager") - self.piece_manager = piece.PieceManager(self, self.manager_bus, "piece_manager") - self.scene_manager = scene.SceneManager(self, self.manager_bus, "scene_manager") - self.turn_manager = turn.TurnManager(self, self.manager_bus, "turn_manager", self.camera) + self.sheet_manager = images.SheetManager(self, self.manager_bus, self.camera, "sheet_manager") + self.sound_manager = sound.SoundManager(self, self.manager_bus, self.camera, "sound_manager") + self.menu_manager = menu.MenuManager(self, self.manager_bus, self.camera, "menu_manager") + self.board_manager = board.BoardManager(self, self.manager_bus, self.camera, "board_manager") + self.piece_manager = piece.PieceManager(self, self.manager_bus, self.camera, "piece_manager") + self.scene_manager = scene.SceneManager(self, self.manager_bus, self.camera, "scene_manager") + self.turn_manager = turn.TurnManager(self, self.manager_bus, self.camera, "turn_manager") # Setup (This is WIP) self.sheet_manager.load_sheets_from_json("sheets.json") diff --git a/src/images.py b/src/images.py @@ -35,9 +35,9 @@ class SheetManager(manager.Manager): them. """ - def __init__(self, game, bus, name): + def __init__(self, game, bus, camera, name): - super().__init__(game, bus, name) + super().__init__(game, bus, camera, name) # Important values self.sheets_def = {} diff --git a/src/manager.py b/src/manager.py @@ -52,11 +52,12 @@ class Manager(subsystem.GameSubsystem): self._effectual = x # Initialization - def __init__(self, game, bus, name): + def __init__(self, game, bus, camera, name): # Initial values super().__init__(game) self.bus = bus + self.camera = camera self.name = name # Property defaults diff --git a/src/menu.py b/src/menu.py @@ -22,9 +22,9 @@ class MenuManager(manager.Manager): access those groups to draw them. """ - def __init__(self, game, bus, name): + def __init__(self, game, bus, camera, name): - super().__init__(game, bus, name) + super().__init__(game, bus, camera, name) # Fix properties self.effectual = True diff --git a/src/piece.py b/src/piece.py @@ -23,10 +23,10 @@ class PieceManager(manager.Manager): with pieces and tiles. """ - def __init__(self, game, bus, name): + def __init__(self, game, bus, camera, name): # Parent initialization - super().__init__(game, bus, name) + super().__init__(game, bus, camera, name) # Entity values self.pieces = pygame.sprite.LayeredDirty() diff --git a/src/scene.py b/src/scene.py @@ -22,10 +22,10 @@ class SceneManager(manager.Manager): complicated scenes. """ - def __init__(self, game, bus, name): + def __init__(self, game, bus, camera, name): # Parent initialization - super().__init__(game, bus, name) + super().__init__(game, bus, camera, name) # Fix properties self.effectual = True diff --git a/src/sound.py b/src/sound.py @@ -24,10 +24,10 @@ class SoundManager(manager.Manager): files and is called to play them. """ - def __init__(self, game, bus, name): + def __init__(self, game, bus, camera, name): # Parent initialization - super().__init__(game, bus, name) + super().__init__(game, bus, camera, name) # Important values self.sounds = {} diff --git a/src/turn.py b/src/turn.py @@ -23,10 +23,10 @@ class TurnManager(manager.Manager): info about the current turn in the UI. """ - def __init__(self, game, bus, name, camera): + def __init__(self, game, bus, camera, name): # Parent initialization - super().__init__(game, bus, name) + super().__init__(game, bus, camera, name) # Important values self.camera = camera