🎨 No longer using SGDBSave

- Details window uses a Pipeline with SGDBTask
- Store saves managers in a type: instance dict
- Removed SGDBSave
This commit is contained in:
GeoffreyCoulaud
2023-06-10 16:22:09 +02:00
parent 3a0911e742
commit dcd4357e57
3 changed files with 43 additions and 150 deletions

View File

@@ -7,18 +7,18 @@ from src.store.pipeline import Pipeline
class Store:
"""Class in charge of handling games being added to the app."""
managers: set[Manager]
managers: dict[type[Manager], Manager]
pipelines: dict[str, Pipeline]
games: dict[str, Game]
def __init__(self) -> None:
self.managers = set()
self.managers = {}
self.games = {}
self.pipelines = {}
def add_manager(self, manager: Manager):
"""Add a manager class that will run when games are added"""
self.managers.add(manager)
"""Add a manager that will run when games are added"""
self.managers[type(manager)] = manager
def add_game(
self, game: Game, additional_data: dict, replace=False
@@ -51,7 +51,7 @@ class Store:
return None
# Run the pipeline for the game
pipeline = Pipeline(game, additional_data, self.managers)
pipeline = Pipeline(game, additional_data, self.managers.values())
self.games[game.game_id] = game
self.pipelines[game.game_id] = pipeline
pipeline.advance()