Skip to content

Latest commit

 

History

History
177 lines (146 loc) · 45.1 KB

UseCases.md

File metadata and controls

177 lines (146 loc) · 45.1 KB

Home

Use Case

Models Design Models Design


USE CASE 1
Name Info
Actors Player
Brief Description Information about the game is displayed.
Preconditions none
Basic flow The Player selects “info” and information about the game and it's rules is displayed.                                                                
Alternate flows none
Postconditions     The player can select "more info" and, if he does it, the Klotski wikipedia page opens.

USE CASE 2
Name GitHub
Actors Player
Brief Description The Player visualizes the GitHub repository.                                                                                                                                     
Preconditions The Player must be connected to internet.
Basic flow The Player selects “GitHub”.
Alternate flows none
Postconditions     The GitHub repository webpage opens.

USE CASE 3
Name Select Level
Actors Player
Brief Description The Player chooses one of the 5+1 configurations.
Preconditions none
Basic flow Player selects one of the 5+1 levels and starts the game (use case #4).
Alternate flows Player doesn’t select a level. Level 1 is selected by default.
Postconditions     The selected level is displayed.
Note The level can also be changed after starting a game (use case #4) clicking the “level” button and choosing one of the 6 options. It equals to starting a new game (use case #4).

USE CASE 4
Name Start Game
Actors Player
Brief Description The Player starts the game.
Preconditions none
Basic flow The player selects "play" and a new game starts.
Alternate flows none
Postconditions     The game board with the selcted configuration is displayed and the Player can move the pieces.                                            

USE CASE 5
Name Move
Actors Player
Brief Description The Player can move the pieces according to the game rules.
Preconditions Use case #4.
Basic flow The Player drags the pieces to the free spots.
Alternate flows The Player tries to drag the blocks outside the board, to move them diagonally or to overlapping them. The piece won’t move in any of these cases.
Postconditions     The moves counter increments and now the Player has the opportunity to undo (use case #6). The game ends if the 2x2 square moves to the winning position.

USE CASE 6
Name Undo
Actors Player
Brief Description The player undoes the move.
Preconditions The moves counter can’t be 0, at least one move must have been performed.
Basic flow The Player selects "undo" and the board returns to the previous configuration.
Alternate flows Moves counter is 0 and can’t decrement. The board configuration doesn’t change.
Postconditions     The moves counter decrements by one and the board returns to the previous configuration.                                                  

USE CASE 7
Name Save
Actors Player
Brief Description The current board configuration gets saved.
Preconditions The player selected "settings"(after the game started).
Basic flow After making some moves, the Player saves the configuration.
Alternate flows The player saves before making any move. That equals to saving the selected configuration.                                                  
Postconditions     The configuration is saved and can be loaded (use case #8).

USE CASE 8
Name Load
Actors Player
Brief Description The saved configuration gets loaded.
Preconditions The player saved a game (use case #7) and selected "settings"(after the game started).
Basic flow The Player saves a game, makes some moves and then loads the saved file.
Alternate flows The Player tries to load a configuration without saving one before. A message window is displayed.                                     
Postconditions     The saved configuration is displayed and the moves counter changes too.

USE CASE 9
Name Return to the main menu
Actors Player
Brief Description The Player returns to the home screen from the settings menu.
Preconditions The player selected "settings"(after the game started).
Basic flow The main menu is displayed as selected by the Player.
Alternate flows none
Postconditions     The situation is the same as when the application just opened.                                                                                                     

USE CASE 10
Name Reset
Actors Player
Brief Description The Player resets the game.
Preconditions A game must have started (use case #4).
Basic flow After making some moves the Player decides to reset.
Alternate flows The Player resets the game without making any move, the configuration doesn’t change.
Postconditions     New game with the same level starts.
Note If the player selects the "random" level and resets the game, a new one with a different random configuration will start.  

USE CASE 11
Name Next best move
Actors Player and Solver
Brief Description The best possible move is performed automatically as asked by the Player.
Preconditions The Player must be connected to internet.
Basic flow The Solver performes the best move after the Player selected "best move".
Alternate flows The player selects this option without being connected to the internet. A message window is displayed.
Postconditions     The configuration changes and moves counter increments by one. The game ends if the 2x2 square moves to the winning position.                                                                                              

USE CASE 12
Name Solve all
Actors Player and Solver
Brief Description The game is solved automatically as asked by the Player.
Preconditions The Player must be connected to internet.
Basic flow The player selects "solve all" and the pieces move automatically until the 2x2 square reaches the winning position.            
Alternate flows The player selects this option without being connected to the internet. A message window is displayed.
Postconditions     Win (use case #16).

USE CASE 13
Name Stop
Actors Player and Solver
Brief Description Player stops the automatic solving.
Preconditions Use case #12.
Basic flow After letting the Solver move some pieces the Player selects "stop".
Alternate flows The Player doesn't stop the Solver. The Solver won't stop until the end of the game.                                                                
Postconditions     The Solver stops solving.

USE CASE 14
Name Win
Actors Player and/or Solver
Brief Description The Player (or Solver) wins the game.
Preconditions The 2x2 square is moved to the winning position.
Basic flow The Player (or Solver) moves the pieces until the 2x2 square reaches the winning position.                                                    
Alternate flows The Player isn’t able to make the 2x2 square go to the winning position.
Postconditions     Restart (same as use case #10) or return to the main menu (use case #9).