Use Cases - luney-sp-76/SaveThePlanetSE1 GitHub Wiki
Navigation:
This Page: Use Cases
This Section:
4i. Actors
4ii. Scenarios
4iii. Use Case Diagrams
example of game play scenarios and UC
Home
1. Requirements
2. Game and Board Design
3. Coding Standards
[5. Sequence Diagrams](Sequence Diagrams)
[6. UML Class Diagram](UML Class Diagram)
7. README
[8. Training + Useful Resources](Training + Useful Resources)
9. Our Kanban Board
Use Case Descriptions
Descriptor | Description |
---|---|
Name | UC-01 Game Set Up |
Objective | A Player starts the program and enters the number of players. Each player enters a name. |
Actors | Player |
Precondition | The Player has opened the console. |
Main Flow | 1. A player has responded to “Start a game?” with the option ‘y/yes’. 2. The Player who has started game enters the number of player(s) (1-4). 3. Each player enters their name. 4. The system validates each entry. 5. Each name must be a single alpha-numeric string with no spaces, 2 to 30 characters in length, and unique for each player. 6. If the name entered fails validation, then a message is displayed explaining why i.e., “Name too long” or “Name already taken.” 7. Once a name entered has passed validation then it is stored against a player. 8. Once all players have selected a name, a welcome screen is displayed for 10 seconds. |
Alternative Flows |
Alternative Flow 1 1. At 2] If no input is received after 1 minute the console displays a warning. 2. After 2 minutes of inactivity the program ends |
Post conditions | Game Play Begins |
Descriptor | Description |
---|---|
Name | UC-02 Game Play Begins |
Objective | A new game has started and a stats board is displayed for 15 seconds. The Board shows player names displayed alongside their player number (1-4), starting credit of £300, and current resources e.g. |
Precondition | Player has started a game and entered names for players. |
Main Flow | 1. The system creates players. 2. Players are all on the Start Square. 3. All players are assigned £300. 4. The stats board displays all players current stats. 5. Player 1 is asked to roll the dice. |
Alternative Flows | N/A |
Post conditions | Player 1 can take their first move. |
Descriptor | Description |
---|---|
Name | UC-03 Restart A Saved Game. |
Objective | A Player can restart a saved game |
Actors | Player, System. |
Precondition | Player has started a game and entered names for players. |
Main Flow | 1. The System prompts a player by printing to console “Do you want to load a Saved Game? y/n” 2. The Player responds with ‘y/yes’. 3. The system will list the 3 most recent saved games, labelled 1-3. They will be in chronological order, with their names and dates also displayed. 4. The Player chooses a valid number, the saved game restarts and the state of play will be restored from the point when the game was saved. |
Alternative Flows |
Alternative Flow 1 1. At 1] The system has no saved games on file for that user. 2. The system will not Prompt the user to restart a game. Alternative Flow 2 1. At 2] The Player responds with ‘n/no’ 2. The System will begin the Start Game Process. Alternative Flow 3 1. At 4] The Player chooses an invalid number the System will print to console “Please choose a valid game number”. 2. The system will list the 3 most recent saved games, labelled 1-3. They will be in chronological order, with their names and dates also displayed. 3. The Player chooses a valid number, the saved game restarts and the state of play will be restored from the point when the game was saved. |
Post conditions | Success Guarantee: A Saved Game is restarted. |
Extension Points | * Start Game Process |
Descriptor | Description |
---|---|
Name | UC-04 Take a Turn. |
Objective | To allow a player to take action on their turn. |
Actors | Player. |
Precondition | The Player has begun their turn. |
Main Flow | 1. The Player chooses “Trade Area” and completes the ‘Trade’ use case. OR The Player chooses “Develop Area” and completes the ‘Minor Development’ or ‘Major Development’ use case. 2. The Player selects “Roll Dice”. 3. The Player completes the ‘Player Lands on a Square’ use case. 4. The Player completes various use cases depending on progress around board, including ‘Pass “Collect Funding”’, ‘Purchase Square’, ‘Pay Rates Bill’, ‘Liquidation’, ‘Pick a Card’. |
Alternative Flows |
Alternative Flow 1 1. At 1] If no input is received from the user in 30 seconds, the use case ends and the next player takes their turn. |
Post conditions | The player is moved forward/backwards by the amount of spaces specified on the card. |
Descriptor | Description |
---|---|
Name | UC-05 Player Lands on a Square. |
Objective | Player moves to a Square. |
Actors | Player, Square. |
Precondition | It is the Player’s turn and they have rolled the dice. |
Main Flow | 1. The Player moves x number of squares, as determined by the dice roll. |
Alternative Flows | N/A |
Post conditions | The Player is shown the available options for continuing their turn, including the current state of the square. |
Descriptor | Description |
---|---|
Name | UC-06 Pass “Collect Funding”. |
Objective | To allow players to collect money. |
Actors | Player, Square. |
Precondition | The Player must have landed on, or passed, the “Collecting Funding” square. |
Main Flow | 1. The Player receives £300. |
Alternative Flows | N/A |
Post conditions | The Player’s total funds are increased by £400. |
Descriptor | Description |
---|---|
Name | UC-07 Control A Field. |
Objective | To show when a Player is in complete control of an Field. |
Actors | Player, Square. |
Precondition | The Player must have purchased all Properties in a given Field. |
Main Flow | 1. The Player receives a title related to the field. |
Alternative Flows | N/A |
Post conditions | The Player’s name is now displayed with their new title to indicate ownership of the area. The Player is now able to develop the area. |
Descriptor | Description |
---|---|
Name | UC-08 Pick a Card – Player Movement. |
Objective | To allow a player to pick up a game card. |
Actors | Player, Square, Card. |
Precondition | The Player must have landed on a Chance square. |
Main Flow | 1. A randomly chosen card relating to the Player’s location is shown on screen to the Player. 2. The Player is moved forward or backwards a set number of spaces, based on the information on the card. |
Alternative Flows | N/A |
Post conditions | The Player is moved forward/backwards by the number of spaces specified on the card. |
Descriptor | Description |
---|---|
Name | UC-09 Pick a Card – Player Funding Change. |
Objective | To allow a player to pick up a game card. |
Actors | Player, Square, Card. |
Precondition | The Player must have landed on a Chance square. |
Main Flow | 1. A randomly chosen card relating to Player’s funding total is shown on screen. 2. The funding total of the affected Player is increased or decreased based on the information on the card. |
Alternative Flows | N/A |
Post conditions | The Player’s funding total is affected by the amount shown on the card. |
Descriptor | Description |
---|---|
Name | UC-10 Roll the Dice. |
Objective | To roll two six-sided dice, so the Player can receive a total figure and move forward the corresponding number of places. |
Actors | Player |
Precondition | The Player should have started the game. |
Main Flow | 1. The last Player has finished their turn. 2. The next Player then selects “Roll Dice”. 3. The dice roll takes a few seconds. 4. A message is displayed saying “Dice Rolling…” 5. A message is then displayed saying “Die 1 is x, Die 2 is y. You will move forward x+y places.” 6. Player then moves forward the number of spaces. |
Alternative Flows | N/A |
Post conditions | The Player moves forward on board. |
Descriptor | Description |
---|---|
Name | UC-11 Display Stats. |
Objective | To communicate players’ game progress. |
Actors | Player |
Precondition | The Player has selected “View Stats” OR a change occurs to the stats, e.g., the Player passes “Collect Funding”, a rates bill is paid or a development is funded. |
Main Flow | 1. Current game stats are displayed on screen. |
Alternative Flows | N/A |
Post conditions | Full player stats are displayed on screen, showing each player’s current funding available and any related player titles. |
Descriptor | Description |
---|---|
Name | UC-12 Purchase Square. |
Objective | To let a player purchase an unowned square. |
Actors | Player, Square. |
Precondition | The Player must have landed on the unowned square. |
Main Flow | 1. The Player selects “Purchase Field” option. 2. The cost of the field is deducted from the Player’s funding total. |
Alternative Flows |
Alternative Flow 1 1.At 2] If the Player has insufficient funding, the purchase is unsuccessful and no money is deducted from the Player. |
Post conditions | Ownership of the Square is transferred to the Player. |
Descriptor | Description |
---|---|
Name | UC-13 Pay Rates Bill. |
Objective | To deduct money from a player’s funding total when landing on an owned square. |
Actors | Player, Square. |
Precondition | The Player must have landed on the owned square. |
Main Flow | 1. Current Square ownership is displayed to the Player. 2. The Square’s rates are deducted from the Player’s total funds. |
Alternative Flows |
Alternative Flow 1 1. At 2] If the Player has insufficient funding, and owns a square, the Player follows the Liquidation use case. Alternative Flow 2 1. At 2] If the Player has insufficient funding, and does not own a square, the Player is removed from play. |
Post conditions | The Player’s funding total is reduced. |
Descriptor | Description |
---|---|
Name | UC-14 Liquidation. |
Objective | To allow a player to exchange owned squares for money. |
Actors | Player, Square. |
Precondition | The Player must have landed on an owned Square, have insufficient funds to pay the rates bill and successfully complete the Pay Rates Bill use case. The Player must currently own at least one square. |
Main Flow | 1. The lowest value Square is removed from the Player’s owned Squares. 2. The Square’s value is added to the Player’s funding total. 3. The Square is now available for purchase by other players. 4. The the outstanding Rates bill is deducted from the Player’s total funds. |
Alternative Flows |
Alternative Flow 1 1.At 4] If the Player still has insufficient funds and holds property, the Liquidation use case is repeated. Alternative Flow 2 1. At 4] If the Player still has insufficient funds and does not own a square, the Player is removed from play. |
Post conditions | The Player’s funding total is increased by the value of the removed square. The the outstanding Rates bill is deducted from the Player’s total funds.The affected Square is now available for purchase. Any relevant titles are removed from the Player. |
Descriptor | Description |
---|---|
Name | UC-15 Minor development. |
Objective | To allow a minor development of an owned field. |
Actors | Player, Square. |
Precondition | The Player must own all properties in a given field. |
Main Flow | 1. The Player selects “Develop Field. 2. The cost of development is deducted from the Player’s available funds. |
Alternative Flows |
Alternative Flow 1 1. At 2] If the Player has insufficient funds, development does not occur and the use case ends. |
Post conditions | The Player’s available funds total is reduced by the cost of development and the affected Square’s rates are increased. |
Descriptor | Description |
---|---|
Name | UC-16 Major development. |
Objective | To allow a major development of an owned field. |
Actors | Player, Square. |
Precondition | The Player must own all properties in a given field. |
Main Flow | 1. The Player selects “Develop Field. 2. The cost of development is deducted from the Player’s available funds. |
Alternative Flows |
Alternative Flow 1 1. At 2] If the Player has insufficient funds, development does not occur and the use case ends. |
Post conditions | The Player’s available funds total is reduced by the cost of development and the affected Square’s rates are increased. |
Descriptor | Description |
---|---|
Name | UC-17 Trade. |
Objective | To allow players to transfer ownership of Squares. |
Actors | Player(s), Square(s). |
Precondition | The Player must own at least one Square and at least one other Square must be owned by another Player. |
Main Flow | 1. The Player selects “Trade”. 2. The Player selects which of their owned Square’s they would like to trade. 3. The player selects a Square owned by another Player. 4. The player responds ‘y/yes’ to the trade offer. 5. If the Squares have the same value, a direct swap occurs. Otherwise, the owner of the lower valued Square pays the difference to the other Player. |
Alternative Flows |
Alternative Flow 1 1. At 3] If the offered player responds ‘n/no’, the trade does not occur. Alternative Flow 2 1. At 5] If the Squares have a difference in value and a player has insufficient funds to pay the difference, the trade does not occur. |
Post conditions | The Player’s first Square is removed from their list of owned Square's, and replaced with the new Square. The Player’s available funds total is amended if applicable, based on trade value. |
Descriptor | Description |
---|---|
Name | UC-18 Save The Game. |
Objective | When a player chooses to save a game to resume later. |
Actors | Player, System, File. |
Precondition | A game must already be in progress. |
Main Flow | 1. The active Player chooses “Save Game” from the action menu. 2. The system prompts the Player with “Do you wish to Save the Game? y/n”. 3. The Player responds with ‘y/yes’. 4. The system prompts the Player for a name for the Game file with “Please enter a name for the saved game.” 5. The Player enters a valid, unique name for the game to be saved. 6. The system saves the game to a saved game file. 7. The system confirms the game has been saved. |
Alternative Flows |
Alternative Flow 1 1. At 3] The Player responds to the prompt with ‘n/no’. 2. The system prompts the Player with “Do you wish to continue the game? y/n” 3. The Player responds with ‘y/yes’. 4. The system returns to the game at the current state. Alternative Flow 2 1. At 3] The Player responds to the prompt with ‘n/no’. 2. The system prompts the Player with “Do you wish to continue the game? y/n”. 3. The Player responds with ‘n/no’. 4. The system will follow *Play another Game. Alternative Flow 3 1. At 5] The player enters an invalid, or non-unique name for the game to be saved. 2. The system responds with a prompt “This name is invalid or has been used already, please enter a name for the saved game.” Alternative Flow 4 1. At 6] The system attempts to save the game to a saved game file. 2. There are 3 saved games already on file 3. The system responds with a prompt “There are three saved games on the file by continuing the oldest game …(name of game)…will be removed. Do you want to continue y/n?” 4. The Player responds to the prompt with ‘y/yes’. 5. The system removes the oldest game on file 6. The system saves the game to file and this will be the newest 7. The system confirms the game has been saved. Alternative Flow 5 1. At 6] The system attempts to save the game to a saved game file. 2. There are 3 saved games already. 3. The system responds with a prompt “There are three saved games on the file by continuing the oldest game …(name of game)…will be removed. Do you want to continue y/n?” 4.The Player responds with ‘n/no’. 5. Then the system returns to the game at the current state |
Post conditions | Success Guarantee: A Games State of Play is saved to a local file Minimal Guarantee: The system prints to console any blocks or errors in regards to processing the save game request. |
Extension Points | * Play Another Game |
Descriptor | Description |
---|---|
Name | UC-19 End the game. |
Objective | When any player quits, all fields are owned or developed or when only one Player has resources remaining. |
Actors | Player. |
Precondition | The players should have started the game. |
Main Flow | • When any player quits the game will end. • When all fields are owned and developed the game will end. • When only 1 Player retains resources the game will end. |
Alternative Flows | N/A |
Post conditions | Game ends, the winner and stats of other players are displayed. |
Descriptor | Description |
---|---|
Name | UC-20 Play Another Game. |
Objective | A player chooses to play another game. |
Actors | Player, System. |
Precondition | A game will have just ended or A game has not been started, but the start game use case has been initiated. |
Main Flow | 1. The System will print to screen a prompt “Do you wish to play another game? y/n” 2. The Player responds with ‘y/yes’. 3. The System will * Start New Game |
Alternative Flows |
Alternative Flow 1 1. At 2] The Player responds with ‘n/no’. 2. The system * Ends the Session. |
Post conditions | Success Guarantee: The Player’s choice of playing another game is met by Start A New Game or End Session. Minimal Guarantee: The system ends the session gracefully |
Extension Points | *End The Session *Start New Game |
Descriptor | Description |
---|---|
Name | UC-21 End Session. |
Objective | A player chooses to quit the application. |
Actors | Player. |
Precondition | The application has been launched. |
Main Flow | 1. The System prompts the user by printing to console “Do you want to Play Another Game y/n”? 2. The Player responds with ‘n/no’ 3. The System prints to console “Thanks for playing!” 4. The Application closes. |
Alternative Flows |
Alternative Flow 1 1. At 2] The Player responds with ‘y/yes’. 2. The system begins the * Start Game Process. |
Post conditions | Success Guarantee: The application closes without errors. Minimal Guarantee: The application throws an exception error. |
Extension Points | * Start Game Process. |
Use Case Diagram for Save The Planet
Home
This Section:
4i. Actors
4ii. Scenarios
1. Requirements
2. Game and Board Design
3. Coding Standards
[5. Sequence Diagrams](Sequence Diagrams)
[6. UML Class Diagram](UML Class Diagram)
7. README
[8. Training + Useful Resources](Training + Useful Resources)
9. Our Kanban Board