Skip to content

[US-05] Saving and restoring the game

As a player I want to be able to save the current situation of the game and later load it again to continue at the same point, so that progress is not lost.

The system should store everything belonging to the match — boards, ship placements, shots and results, which side’s turn it is, difficulty, and the running time — in a file that the player can choose. Hidden things must stay hidden after loading. When loading, the previous game state must be shown again exactly as before, with all visible and hidden parts consistent. If the file is missing, damaged or incompatible, the program should report this and leave the running game unchanged. Saving right before loading should not change anything in the match’s state. The player must be able to choose file location and name.

Acceptance understanding: – If the game is saved and loaded right away, every visible part and all internal values should be identical. – If a corrupted file is loaded, an error is displayed and the game remains the same. – If a completed game is saved and later loaded, it stays finished and waits for a new start.