wavesinaroom / my_odin_project_battleship

0 stars 0 forks source link

Player factory function #8

Closed wavesinaroom closed 1 year ago

wavesinaroom commented 1 year ago

Players can take turns playing the game by attacking the enemy Gameboard.

wavesinaroom commented 1 year ago

Player's name and board properties have already been tested. Now, I think I'm gonna need a Game Manager that facilitates communication between a player and a opponent to trigger firing missiles.

wavesinaroom commented 1 year ago

I could find out the expect that helps me test if the EventManager.notification methods has been called. However, I've not found a way to mock that function in spite of getting a log when it's called

wavesinaroom commented 1 year ago

Player factory function is ready, tests can't be conducted for the moment though. I want to test the event manager on player fire method called but I'm stuck with mocking it that's why I decided to continue with the game manager. Sort of breaking the natural order of the project but I don't want to waste time

wavesinaroom commented 1 year ago

I'm done with coding the other features of the game. CPU current state is good enough for initial tests, I'll expand AI functionality later on. Anyways, player function comes back to its previous testing stage

wavesinaroom commented 1 year ago

Finally, I could test players attack with spies. Mock function might work in another situation but for now they've been misleading in player's tests