|
|
|
|
@ -1,8 +1,7 @@
|
|
|
|
|
# Card Game
|
|
|
|
|
|
|
|
|
|
```plantuml
|
|
|
|
|
|
|
|
|
|
CardGame --|> Pile
|
|
|
|
|
CardGame o-- Pile
|
|
|
|
|
class CardGame {
|
|
|
|
|
int numberOfPlayers;
|
|
|
|
|
public Player[] players;
|
|
|
|
|
@ -14,8 +13,8 @@ class CardGame {
|
|
|
|
|
public void play()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Player --|> Pile
|
|
|
|
|
Pile --|> Card
|
|
|
|
|
Player o-- Pile
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Player {
|
|
|
|
|
String name;
|
|
|
|
|
@ -27,7 +26,16 @@ class Player {
|
|
|
|
|
public int cardsCount()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Pile {
|
|
|
|
|
ArrayList *-- Card
|
|
|
|
|
|
|
|
|
|
class ArrayList< Card > {
|
|
|
|
|
public boolean isEmpty()
|
|
|
|
|
public int size()
|
|
|
|
|
public boolean add(Card card)
|
|
|
|
|
public boolean addAll(Collection<Card> card)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Pile extends ArrayList {
|
|
|
|
|
public static Pile createDeck(int numberOfCards)
|
|
|
|
|
public Pile getCardsForPlayer(int number)
|
|
|
|
|
public void shuffle()
|
|
|
|
|
|