diff --git a/button_2/blackboard.qmd b/button_2/blackboard.qmd index 5bc619d..5fa9bb1 100644 --- a/button_2/blackboard.qmd +++ b/button_2/blackboard.qmd @@ -86,4 +86,20 @@ from classes.game.node_engine import NodeEngine node_engine = NodeEngine() +``` + +## game + + +```{python} +from classes.game.game_engine import GameEngine + +game_engine = GameEngine() + +``` + + +```{python} +game_engine.current_node + ``` \ No newline at end of file diff --git a/button_2/classes/game/game_engine.py b/button_2/classes/game/game_engine.py new file mode 100644 index 0000000..c71e393 --- /dev/null +++ b/button_2/classes/game/game_engine.py @@ -0,0 +1,13 @@ +from ..data.button_dat import ButtonDat +from ..entities.employee import Employee +from .node_engine import NodeEngine + +class GameEngine: + def __init__(self): + self.button_dat = ButtonDat() + self.employee = Employee(self.button_dat) + self.current_node = self.button_dat.nodes_df.node.iloc[0] + self.narrative_path = [self.current_node] + self.nodes_visited = {self.current_node: 1} + self.node = NodeEngine(self.button_dat, self.employee) + diff --git a/button_2/tests/game/test_game_engine.py b/button_2/tests/game/test_game_engine.py index a42e20c..f571719 100644 --- a/button_2/tests/game/test_game_engine.py +++ b/button_2/tests/game/test_game_engine.py @@ -1,13 +1,15 @@ +import pytest from button_2.classes.game.game_engine import GameEngine -from button_2.classes.data.button_dat import ButtonDat -from button_2.classes.entities.employee import Employee # this tests that the game engine has the required attributes & methods # instantiate the game engine # nb this is where I will pass hyper parameters to tweak probabilities -button_game <- GameEngine() +@pytest.fixture +def button_game(): + button_game = GameEngine() + return button_game # test the game engine is a thing def test_game_engine(button_game: GameEngine):