Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions button_2/blackboard.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

```
13 changes: 13 additions & 0 deletions button_2/classes/game/game_engine.py
Original file line number Diff line number Diff line change
@@ -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)

8 changes: 5 additions & 3 deletions button_2/tests/game/test_game_engine.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down