Actors:

System

The server or client implementing the game rules

Client

The front end to the game

Server

The game engine and connectivity manager

Player

a person playing the game.  There will be a maximum of 2 people playing the game.

Opponent

each player is an opponent to an other.

 

 

Use Cases:

Use Case ID:

UC000

Use Case Name:

Start Client

 

1.      Player types client on command line and hits enter

2.      Client connects to server.

3.      Client retrieves a list of saved games from server

4.      Client registers the player on the server.

Extensions

2a  Client can not connect to server. Terminate game.

 

Use Case ID:

UC001

Use Case Name:

Start New Game

 

5.      Player chooses to play a new game.

6.      system initializes the game state to a new game

7.      Player waits for opponent to join the game.

8.      opponent joins the game  UC003

Extensions

 

 

Use Case ID:

UC002

Use Case Name:

Start Saved Game

 

1.      Player chooses to restore a saved game.

2.      system initializes the game state to a saved game

3.      Player waits for opponent to join the game.

4.      opponent joins the game  UC003

Extensions

1a  No saved game: message alerts player and instructs to start new game. UC001

 

 

Use Case ID:

UC003

Use Case Name:

Join Game

 

1.      player joins a game.

2.      system displays game state to both players.

3.      system gives turn to player starting the game. UC004

Extensions

2a  No game in progress: message alerts user instructs to try step 1.

 

Use Case ID:

UC004

Use Case Name:

Give Turn

 

1.      System Checks that the game is still playable and has not ended.

2.      System instructs the player with the turn that it is the players turn to make a move.

3.      system enables the controls of the player who’s turn it is.

4.      system displays a message to the opponent that it is not his/her turn.

5.      System disables controls of opponent.

6.      System displays the game grid for both player and opponent depending on there view of the world.

7.      generate any necessary messages and display them in a text area to player and/or opponent.

Extensions

1a  if game has ended then send messages to players, to be displayed in a text area, containing the winner (i.e. player or opponent) and any further statics. Invite to play new game. UC001

 

Use Case ID:

UC005

Use Case Name:

Move Ship

 

1.      player selects a ship from available ships

2.      player selects direction.

3.      player specifies the number of moves.

4.      player instruct the system to move the ship.

5.      system makes the move.

6.      system gives turn to opponent. UC004

Extensions

4a  if move is illegal or number squares exceed the capability of the ship system gives turn. UC004 and system sends a message to player indicating ship has not moved or the amount the ship has been able to move by.

 

Use Case ID:

UC006

Use Case Name:

Rotate Ship

 

1.      player selects a ship from available ships

2.      player selects an angle between 0->180 or between 0->-180.

3.      player instructs system to rotate ship.

4.      system makes the rotation.

5.      system gives turn to opponent. UC004

Extensions

3a  if move can not be done system gives turn. UC004 and system sends a message to player indicating ship has not rotated.

 

Use Case ID:

UC007

Use Case Name:

Immerse Mine

 

1.      player selects a “Minesweeper” from a list of available minesweepers.

2.      player selects a square in Manhattan direction and adjacent to minesweeper. UC008.

3.      player instructs the system to immerse mine.

4.      system deposits a mine in the square..

5.      system gives turn to opponent. UC004

Extensions

3a  if move can not be done (i.e. square is illegal,) system gives turn. UC004 and system sends a message to player indicating mine has not been deposited.

 

Use Case ID:

UC008

Use Case Name:

Select Square

 

1.      player selects a row number.

2.      player selects a column.

Extensions

 

 

Use Case ID:

UC009

Use Case Name:

Withdraw Mine

 

1.      player selects a “Minesweeper” from a list of available minesweepers.

2.      player selects a square in which the mine might be.UC008

3.      player instructs the system to withdraw mine.

4.      system removes the mine from the square..

5.      system gives turn to opponent. UC004

Extensions

3a  if move can not be done (i.e. no mine is on the square) system gives turn. UC004 and system sends a message to player indicating no mine has been withdrawn..

 

Use Case ID:

UC010

Use Case Name:

Fire Torpedo

 

1.      player selects a ship from a list of available ships..

2.      player selects a square in front of ship carrying direction. UC008

3.      player instructs the system to fire torpedo.

4.      system fires torpedo at the square..

5.      system gives turn to opponent. UC004

Extensions

4a  if the firing can not be done (i.e. square is further than the range of torpedo,) system gives turn, UC004, and system sends a message to player and opponent indicating the result of the action.

 

Use Case ID:

UC011

Use Case Name:

Fire Gun

 

1.      player selects a ship from a list of available ships.

2.      player selects a square in any direction with in gun range. UC008

3.      player pushes the “Fire Gun” button.

4.      system fires at the square..

5.      system gives turn to opponent. UC004

Extensions

4a  if the firing can not be done (i.e. square is further than the range of gun,) system gives turn, UC004, and system sends a message to player and opponent indicating the result of the action.

 

Use Case ID:

UC012

Use Case Name:

Pass Turn

 

1.      player indicates he/she want to pass.

2.      system gives turn to opponent. UC004

Extensions

 

 

Use Case ID:

UC013

Use Case Name:

Repair Ship

 

1.      player selects a ship from a list of available ships.

2.      player instructs the system to repair the selected ship.

3.      system repairs a square of ship.

4.      system gives turn to opponent. UC004

Extensions

3a  if ship is not aligned at the base: give turn UC004

3a  if base can not repair give turn UC004.

3a  if ship has no damaged squares give turn UC004.

 

Use Case ID:

UC014

Use Case Name:

Repair base

 

1.      player instructs the system to repair the base.

2.      system repairs a square of base.

3.      system gives turn to opponent. UC004

Extensions

3a  if base is can not repair: give turn UC004.

3a  if base has no damaged squares give turn UC004.

 

Use Case ID:

UC015

Use Case Name:

Resign Game

 

4.      player instructs the system that he/she want to resign the game.

5.      system notifies player and opponent that game is over and opponent wins.

6.      system invites players to start a new game UC001

Extensions

 

 

Use Case ID:

UC016

Use Case Name:

Save Game

 

1.      player instructs the system to save the game.

2.      system notifies player and opponent that game is saved for later invocation.

3.      system invites players to start a new game UC001.

4.      system invites players to start saved game. UC002

Extensions