|
|
|
|
@ -1,20 +1,25 @@
|
|
|
|
|
# Card Game
|
|
|
|
|
|
|
|
|
|
```plantuml
|
|
|
|
|
Game o-- Pile
|
|
|
|
|
Game o-- Players
|
|
|
|
|
class Game {
|
|
|
|
|
int numberOfPlayers;
|
|
|
|
|
public Player[] players;
|
|
|
|
|
Pile pot;
|
|
|
|
|
Pile draws;
|
|
|
|
|
Players players
|
|
|
|
|
private Pile deck
|
|
|
|
|
|
|
|
|
|
public Game(int numberOfCards, int numberOfPlayers)
|
|
|
|
|
private void createPlayersWithCards(int numberOfPlayers, Pile deck)
|
|
|
|
|
public void play()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Player o-- Pile
|
|
|
|
|
|
|
|
|
|
class Players<extends ArrayList<Player>> {
|
|
|
|
|
Pile pot;
|
|
|
|
|
Pile draws;
|
|
|
|
|
public void play()
|
|
|
|
|
private int playersLeft()
|
|
|
|
|
private void givePotOnWin()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Players *-- Player
|
|
|
|
|
|
|
|
|
|
class Player {
|
|
|
|
|
String name;
|
|
|
|
|
@ -45,9 +50,11 @@ Card o-- Suit
|
|
|
|
|
|
|
|
|
|
class Pile extends ArrayList {
|
|
|
|
|
public static Pile createDeck(int numberOfCards)
|
|
|
|
|
public Pile getCardsForPlayer(int number)
|
|
|
|
|
public Pile take(int number)
|
|
|
|
|
public void shuffle(Random random)
|
|
|
|
|
public boolean uniqueMaximum(Card max, int maxIndex)
|
|
|
|
|
public void shuffle()
|
|
|
|
|
public boolean occurrences(int max)
|
|
|
|
|
public Card getMax()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Card {
|
|
|
|
|
|