You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
797 B
44 lines
797 B
# Card Game
|
|
|
|
```plantuml
|
|
|
|
CardGame --|> Pile
|
|
class CardGame {
|
|
int numberOfPlayers;
|
|
public Player[] players;
|
|
Pile pot;
|
|
Pile draws;
|
|
|
|
public CardGame(int numberOfCards, int numberOfPlayers)
|
|
private void createPlayersWithCards(int numberOfPlayers, Pile deck)
|
|
public void play()
|
|
}
|
|
|
|
Player --|> Pile
|
|
Pile --|> Card
|
|
|
|
class Player {
|
|
String name;
|
|
Pile drawPile;
|
|
Pile discardPile;
|
|
|
|
Player(String name, Pile drawPile)
|
|
public Card draw()
|
|
public int cardsCount()
|
|
}
|
|
|
|
class Pile {
|
|
public static Pile createDeck(int numberOfCards)
|
|
public Pile getCardsForPlayer(int number)
|
|
public void shuffle()
|
|
public boolean uniqueMaximum(Card max, int maxIndex)
|
|
}
|
|
|
|
class Card {
|
|
int number;
|
|
Suit suit;
|
|
|
|
public Card(int number, Suit suit)
|
|
}
|
|
```
|