1
Android Based Rummy Game CS 323 – OBJECT ORIENTED ANALYSIS AND DESIGN
2
Rida-e-Fatima Zainub Wahid
2012-314 2012-420
Rummy Basics
Players :
Human vs. Program
Deck
:
52 Cards
Suits
:
4 suits (Hearts, Clubs, Spades, Diamonds)
Cards
:
10 Cards per Player
Stacks :
2 Stacks (Stock and Discard Pile)
3
4
Ending and Scoring
5
A player wins the hand by being the first to play all the cards in their hand by either melding, laying off or discarding
Card
Score
Aces
1 Point Each
Faces (K, Q & J)
10 Points Each
Other Cards
Pip Value
6
Attributes and Methods
Player
Attributes
Hand hand
String Name
Methods
Player (string playerName)
Void reset ()
String getPlayerName ()
Int getScore ()
Void incrementRoundsWon ()
Void addCard (Card aCard)
Card[] getHand ()
7
Attributes and Methods (Cont.)
Card
Attributes
String Suite
Int Rank
Int Value
Methods
Card (string Suite, int Rank)
String getSuite ()
Int getRank ()
Int getValue ()
8
Attributes and Methods (Cont.)
Deck
Attributes
Card Cards
Methods
Deck ()
Deck dealCard ()
Deck Shuffle ()
Rummy
Attributes
Deck deck
Methods
Rummy ()
Void newRound ()
Void hitPlayer ()
9
Use Case
10
Use Case (Cont.)
A move includes drawing from either stock or discard pile and then discarding a card.
11
References 1.
http://rummy.com/rummyrules.html
2.
https://www.student.cs.uwaterloo.ca/~cs132/Weekly/W05/A05/A0 5classdiagram.html
12