The main objective of this project is the development of a computer system for a Monopoly System. The Rational Rose was used as a diagraming tool.
Monopoly Game Overview
The object of the game of Monopoly is to become the wealthiest player through buying, renting and selling of property. The equipment consists of a board, 2 dice, tokens, 32 houses and 12 Hotels. There are 16 Chance and 16 Community Chest cards, 28 Title Deed cards (one for each property), and play money.
The monopoly board is placed on a TV Screen and the Chance and Community Chest cards are placed face down on their allotted spaces on the board. Each player chooses one token to represent them while travelling around the board.
Each player is given €1500 divided as follows: 2 €500’s, 2 €100’s, 2 €50’s, 6 €20’s, 5 €10’s, 5 €5’s, and 5 €1’s. All remaining money and other equipment such as houses, hotels and title deeds go to the Bank. The Bank pays salaries and bonuses. It sells and auctions properties and hands out the proper Title Deed cards when purchased by a player, it also sells houses and hotels to the players and loans money when required on mortgages. The Bank collects all taxes, fines, loans and interest, and the price of all properties which it sells and auctions.
The player places their token on the corner marked “GO”, then throw’s the dice and move’s their token (in the direction of the arrow) the number of spaces indicated by the dice. Depending on the space the token lands on, the player may be entitled to buy real estate or other properties, or be obliged to pay rent, pay taxes, draw a Chance or Community Chest card, Go To Jail etc… If a player throw’s doubles, they move their token as usual, the sum of the two dice, and are subject to any privileges or penalties pertaining to the space on which they land. Retaining the dice, the player throws again, if they throw doubles three times in succession, the player must move their token immediately to the space marked “In Jail”.
Each time a player’s token lands on or passes over GO, the Banker pays that player a €200 salary. Whenever a player land’s on an un-owned property they may buy that property from the Bank at its printed price. The player then receives the Title Deed card showing ownership. If the player does not wish to buy the property, the Bank sells it through an auction to the highest bidder.
When a player land’s on a property that is owned by another player, the owner collects rent in accordance with the list printed on its Title Deed card. If the property is mortgaged, no rent can be collected. It is an advantage to hold all the Title Deed cards in a colour-group (i.e., Boardwalk and Park Place, or Connecticut, Vermont and Oriental Avenues) because the owner may then charge double rent for unimproved properties in that colour-group. It is even more advantageous to have houses or hotels on properties because rents are much higher than for unimproved properties.
When a player land’s on either the chance or community chest spaces, they take the top card from the deck indicated, follow the instructions and return the card face down to the bottom of the deck. The “Get Out of Jail Free” card is held until used and then returned to the bottom of the deck.
Deliverables
For the above Problem description:
- Identify the actors.
- Construct a Use Case Model.
- Describe in detail any use case from the use case model. The use case must contain an alternate flow.
- Create a conceptual class diagram of the chosen use case. The conceptual class diagram should demonstrate the use of attributes, relationships, navigability, association class, multiplicity and composition.
- Create a glossary that lists and defines all the terms that require clarification.
- Draw a System Sequence diagram from the conceptual model.
- Develop a Contract for any system operation in the system sequence diagram.
- Draw a Collaboration diagram based on the above contract. The collaboration diagram should demonstrate the use of design patterns.
- Draw a Component diagram for the Monopoly system.
- Draw a Deployment diagram for the Monopoly system.
- Presentation (how well does the package of models look?).
- Use of Rational Rose.
Project Requirements
- Project deliverables should be completed individually.
- The main objective of this project is the development of a computer system for a Monopoly System.
- The project is composed of multiple sections or deliverables.
- The project work should be carried out in as homework and in specified labs.
- You may use any diagramming tool (Rational Rose, Visio, Gliffy, Smartdraw etc.) to carry out the project but the final work must be presented on paper.
- The Project needs to be completed and returned to Pádraig de Burca on paper by Friday 6 December 2013.
The Equipment
- board placed on a TV screen
- 2 dice
- tokens
- 32 houses
- 12 hotels
- 16 Chance cards
- 16 Community Chest cards
- 28 Title deed cards (one for each property)
- play money
Use Case Model
Use Case diagram shows a set of use cases and actors (a special kind of class) and their relationships. Use case diagrams address the static use case view of a system, these diagrams are important in organising and modelling the behaviours of a system.
The actor for the use cases of the Monopoly game will be the Player. The Banker is to be considered as part of the game; hence it will not be modelled as an actor.
Use Case Description – “PlayGame”
Use Case Name |
PlayGame |
||||
Purpose |
Land on a space and follow instructions |
||||
Actors |
Player |
||||
Brief Description |
It is the player’s turn and he lands on a space on the board game. He has to carry out the instructions on the space he has landed on according to the game rules. |
||||
Flow Description |
|
A game is currently in progress, and it is this Player’s turn. There is no winner. |
|||
|
It is Players turn |
||||
|
1 |
A player rolls two dice. |
|||
2 |
The system returns the total of the two dice and the details of the location that the player has landed on. |
||||
|
2a |
The system returns the total of the two dice, the details of the location that the player has landed on and pays player €200 salary (because token passed over “GO”) |
|||
2b |
3 |
The system returns the total of the two dice, the details of the location that the player has landed on and message that the player rolled doubles for the first time. After following the space instructions, the player rolls dice second time. |
|||
4 |
The system returns the total of the two dice and the details of the location that the player has landed on. |
||||
4a
|
The system returns the total of the two dice, the details of the location that the player has landed on and pays player €200 salary (because token passed over “GO”) |
||||
4b
|
5 |
The system returns the total of the two dice, the details of the location that the player has landed on and message that the player rolled doubles for the second time. After following the space instructions, the player rolls dice third time. |
|||
6 |
The system returns the total of the two dice and the details of the location that the player has landed on. |
||||
6a |
The system returns the total of the two dice, the details of the location that the player has landed on and pays player €200 salary (because token passed over “GO”) |
||||
6b |
The system moves his token to the space marked “In Jail”. |
||||
|
|||||
|
After token is placed on space corresponding to roll. |
||||
|
This Player’s turn is finished, and it is another Player’s turn. |
Use Case Description – “InitializeGame”
Use Case Name |
InitializeGame |
||
Purpose |
Starts a monopoly game |
||
Actors |
Player |
||
Brief Description |
This use case models a User starting a new Monopoly game |
||
Flow Description |
|
A game is not currently in progress. |
|
|
This use case begins when a player starts monopoly game software. |
||
|
1 |
The primary player requests new game initialization. |
|
2 |
The primary player specifies the number of players who will play the game (2-8 players) |
||
3 |
The system asks each player to choose a token. |
||
4 |
The players roll the dice |
||
5 |
The system records the dice roll. |
||
6 |
The player who rolled the highest starts first and the rest of the players follow. |
||
7 |
The system records details and interacts with the players during the course of the game. |
||
|
|||
|
|||
|
|||
|
The game is in progress, and it is one Player’s turn. |
Conceptual Class Diagram
Conceptual classes
Category |
Classes |
Roles |
Player, Banker |
Events |
MonopolyGame, Round |
Objects |
Board, Dice, Token |
Containers |
Board |
Objects in Containers |
Space |
Associations
Category |
Associations |
A is contained in or on B |
Board Contains Space |
A owns B |
Player Owns Token |
A is known in/on B |
Token Is-on Space |
A is member of B |
Player Plays MonopolyGame |
Examples of required elements
Attributes |
faceValue in Round class. |
Constraints |
Token is moved to Jail when doubles count is 3. Banker pays salary to Player when token lands on or passes over “GO” space. |
Associations |
Player – owns – Token Player – plays MonopolyGame Token – lands on – Space |
Association Class |
Round class attached to Player – plays MonopolyGame association |
Multiplicity |
2-8 Player plays 1 MonopolyGame 1 Player owns 1 Token 0-8 Token is on 1 Space |
Composition |
1 Board contains 40 Spaces |
Conceptual class diagram for the “PlayGame” use case
System Sequence Diagram for a PlayGame Scenario
Contract
Develop a Contract for any system operation in the system sequence diagram.
Name |
rollDice() |
Responsibilities |
Roll two dice and display its face value. Record if it’s double, display space name where token was moved (by the number of spaces indicated by face value). |
Cross References |
Use Case: PlayGame |
Type |
System |
Exceptions |
none |
Pre-conditions |
A round has been created. |
Post-conditions |
|
Collaboration Diagram Based on “rollDice()” Contract
Following collaboration diagram illustrates the relation between objects interacted in build a city use case. As seen below, the methods collaborate with other methods and objects.
Component Diagram
The component diagram’s main purpose is to show the structural relationships between the components of a system. There are five components presented in the diagram:
Monopoly GUI application
Common elements and interfaces used by the framework:
- Board class
- Deck class
- Dice class
- Token class
- Cards class
- PlayerInterface – interface for monopoly players
- PlayerOptions – possible options
Game logic
- Game class – game logic and control
- Player class
Computer player
HumanPlayer – interface for human players
Deployment Diagram
The Monopoly Game is displayed on the TV screen. Computer and TV are in two different rooms.
Glossary
Term |
Category |
Comments |
Player |
Actor |
A player is one who plays the game. |
Bankruptcy |
Use Case |
It starts when player does not have enough money for payment. Player has no mans of paying payment due to banker or another player and cannot mortgage. All of player’s assets are transferred to bank or player to which payment was due. If it’s bankruptcy to banker, banker auctions player’s properties. Player is removed from game. |
BuyHouseOrHotel |
Use Case |
It starts when a player is on their turn. Player chooses to buy house or hotel. Player chooses appropriate space to place houses or hotel. Player makes payment for purchase of house or hotel. |
BuyProperty |
Use Case |
Buy an unoccupied property space It starts when player lands on unowned property. Player is asked whether they wish to buy property. If player declines bank auctions property. If player pays for property, deed card is issued to player by banker. |
DrawACard |
Use Case |
If token lands on community chest or chance space system draws top card of corresponding space. Instructions on card are executed by system. |
GoToJail |
Use Case |
When player is sent to jail, he can use “Get Out of Jail Free” card to get out of jail. |
InitializeGame |
Use Case |
The game is initialized when the player opens a software. The player will be asked to enter the number of players who will play the game. There can be from 2 to 8 players (at least one human and computer players). Each player will be asked to choose a token. The players roll the dice. The system records the dice roll. The player who rolled the highest starts first and the rest of the players follow. The system records details and interacts with the players during the course of the game. |
LiftingOfMortgage |
Use Case |
It starts when player wants to lift mortgage off property. Player pays amount of mortgage plus 10 percent interest. If mortgage is paid for all properties of that color, player is allowed to purchase houses or hotel for that property. Player’s account reflects the removal of the mortgage. |
LoanMoney |
Use Case |
It starts when player does not have enough money to make payment. Property player selects to mortgage has not houses or hotel, banker pays player mortgage value of property. Player’s status reflects mortgage of property. |
PayTax |
Use Case |
If player lands on income tax space, he has to pay €200 to the banker |
PlayGame |
Use Case |
The PlayGame is started when it’s player’s turn. A player rolls two dice. The system returns the total of the two dice and the details of the location that the player has landed on. If a player throw’s doubles, token is moved and player rolls dice again. If player throws doubles three times in succession, the system moves his token to the space marked “In Jail”. Each time a player’s token lands on or passes over “GO”, the Banker pays that player €200 salary. |
PropertyRent |
Use Case |
Pay Rent on an occupied property space It starts when player lands on property that is owned by another player. If owner does not own all properties of that color, standard rent is paid. If owner owns all properties of that color, double rent is paid. If property has one or more houses or hotel, appropriate rent is paid. If property is mortgaged, no rent is paid. |
ReceiveSalary |
Use Case |
It starts when token lands on “GO” space. Each time a player’s token lands on “GO”, the Banker pays that player €200 salary. |
Trade |
Use Case |
It starts when a player is on their turn. Player chooses another player and offers price to buy or sell property. Offer is accepted or declined by the other player. If it’s accepted funds and properties are transferred. Player can also offer to another player a price to buy or sell “Get Out of Jail Free” card or he can offer trade of properties. |
Banker |
The bank holds money, title deed cards, houses and hotels prior to purchase and use by the players. The Bank pays salaries and bonuses, sells and auctions properties, sells houses and hotels and loans money required on mortgages. |
|
Board |
The main playing area is made up of a board of 40 squares with 10 squares per side in the text based version and the basic GUI Board. The alternative boards may have different dimensions. |
|
Dice |
In order to play the game the player rolls the dice and his token is moved according to the amount shown on the dice. |
|
Go |
Initially the tokens are placed on “Go” space. Passing over or landing on “Go” space results receiving €200 salary. |
|
Jail |
A space on board. Tokens are moved to Jail after rolling doubles three times in succession. |
|
MonopolyGame |
After initialization new game is created. |
|
Round |
Player’s turn |
|
Space |
There are two main categories of squares on the board. The first category of squares can be bought by a player – known as Properties. There are three types of properties – sites, utilities and stations. The second category consists of squares that cannot be purchased by anyone. These include squares such as the “GO”, “Go to Jail”, “Jail”, “Community Chest”, “Chance”, “Pay income tax”, “Free Parking”, etc. |
|
Token |
Each player can choose a playing token at the start of the game, the playing token is the identifier for the player during the game. The token is moved along the game board during the course of the game. |
|
Title Deed cards |
Each property has a Title Deed card; which a player receives as proof of ownership when he buys a property. Site title deed cards contain the purchase price, mortgage value and rent for vacant and non-vacant properties. Stations and utilities title deed cards contain the purchase price and the mortgage value. |
|
Chance cards |
When a player lands on a “Chance” square he has to pick a Chance card and follow the instructions on the card. |
|
Community Chest cards |
||
Houses |
A player can buy houses from the Bank and erect them on properties when he has all the properties of a colour-group |
|
Hotels |
A player can buy a Hotel from the Bank when he has 4 houses on each property of a complete colour group. |
|
faceValue |
Attribute |
Total value of two dice |
double |
Attribute |
Rolled dice were doubles |
numberOfPlayers |
Attribute |
Number of Players in current game (from 2 to 8) |
roundCount |
Attribute |
Number of rounds in a game |
doublesCount |
Attribute |
Number of rolled doubles in one Round |
cash |
Attribute |
The amount of cash Banker holds |
balance |
Attribute |
The amount of cash Player holds |
spaceName |
Attribute |
The name of the space with instructions |
rollDice() |
Method |
rolling of two dice |
playGame() |
Method |
creates new game |
display() |
Method |
displays board |
paySalary() |
Method |
Bank pays salary to the Player |
move() |
Method |
moves tokens |
landOn() |
Method |
token lands on space |
countDoubles() |
Method |
counts number of rolled doubles in one round |
References
- Larman, C. (2004) Applying UML and patterns. London: Addison Wesley.
- Stackoverflow ‘Class Diagram Usage in UML’, Available from http://stackoverflow.com/questions/17186152/class-diagram-usage-in-uml/17199082#17199082 [2013]
- Russell C. Bjork ‘ATM Simulation Links – by Topic’, Available from http://www.math-cs.gordon.edu/courses/cps211/ATMExample/