neu-cs4530 / spring24-project-team-208

spring24-project-team-208 created by GitHub Classroom
https://coveytownbattleship.onrender.com/
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Implement and Test BattleShipGameArea #22

Closed alinachiu closed 7 months ago

alinachiu commented 7 months ago
alinachiu commented 7 months ago

I made a small change to the documentation so that the error message is consistent for SetUpGame and the other commands. Otherwise it looks good to me

Thanks! I believe the error should still be 'GAME_NOT_WAITING_TO_START_MESSAGE' instead of 'GAME_NOT_IN_PROGRESS_MESSAGE,' so would it be possible to revert your commit? The reason why is because we place boats during the waiting to start phase and make guesses during the in progress phase. If the game is not in the waiting to start phase, then users cannot make a SetUpGameMove (we don't want users to be able to move their boats mid-game).

mattcasey02 commented 7 months ago

I don't think that logic belongs to this check. This line of code just checks whether a game exists for us to use, so if there is no game then we should error GAME_NOT_IN_PROGRESS. The PlaceBoat and RemoveBoat commands will error if they deem that it is an inappropriate time to place a boat. This is similar to how if you try to make a GameMove when the game has not yet started then the applyMove method will throw an error, not the handleCommand method.

alinachiu commented 7 months ago

I don't think that logic belongs to this check. This line of code just checks whether a game exists for us to use, so if there is no game then we should error GAME_NOT_IN_PROGRESS. The PlaceBoat and RemoveBoat commands will error if they deem that it is an inappropriate time to place a boat. This is similar to how if you try to make a GameMove when the game has not yet started then the applyMove method will throw an error, not the handleCommand method.

That makes sense to me, thanks for clarifying! I've updated the associated test so the checks pass.