🎨 SourceIterator can yield addtitional data

SourceIterator-s can yield a game and a tuple of additional data.
This data will be passed to the Store, Pipeline and Managers.
This commit is contained in:
GeoffreyCoulaud
2023-06-07 14:01:06 +02:00
parent 7eef050a64
commit 98f02da36c
12 changed files with 68 additions and 37 deletions

View File

@@ -20,7 +20,9 @@ class Store:
"""Add a manager class that will run when games are added"""
self.managers.add(manager)
def add_game(self, game: Game, replace=False) -> Pipeline | None:
def add_game(
self, game: Game, additional_data: tuple, replace=False
) -> Pipeline | None:
"""Add a game to the app if not already there
:param replace bool: Replace the game if it already exists
@@ -49,7 +51,7 @@ class Store:
return None
# Run the pipeline for the game
pipeline = Pipeline(game, self.managers)
pipeline = Pipeline(game, additional_data, self.managers)
self.games[game.game_id] = game
self.pipelines[game.game_id] = pipeline
pipeline.advance()