Package | Description |
---|---|
wcg.games |
Classes common to all card games.
|
wcg.games.hearts |
The goal of the HEARTS game is to avoid receiving hearts.
|
wcg.games.war |
War is a very simple card game, mostly played by children.
|
wcg.main |
Classes for managing the web card game service.
|
wcg.shared.cards |
Card related types.
|
wcg.shared.events |
Events used to send information to players.
|
Modifier and Type | Field and Description |
---|---|
(package private) java.util.LinkedList<Card> |
CardCollection.cards |
Modifier and Type | Method and Description |
---|---|
Card |
GameBot.getCardOnTable(java.lang.String nick)
Convenience method to retrieve the card on table
from player with given nick.
|
protected Card |
GameMaster.getCardOnTable(java.lang.String nick)
Convenience method to retrieve the single card on table
of player with given nick.
|
Card |
CardCollection.getFirstCard()
Get first card from collection.
|
Card |
CardCollection.getHighestCard()
Get the highest card using this collection comparator
If this collection is empty returns
null . |
Card |
CardCollection.getLastCard()
Get first card from collection
If this collection is empty returns
null . |
Card |
CardCollection.getLowestCard()
Get the lowest card using this collection comparator.
|
Card |
CardCollection.getRandomCard()
A random card from this collection.
|
Card |
CardCollection.takeCard(Card card)
Take a specific card and return it,
if collection has at least one card; otherwise return
null . |
Card |
CardCollection.takeFirstCard()
Take the first card and return it,
if collection has at least one card.
|
Card |
CardCollection.takeLastCard()
Take the last card and return it,
if collection has at least one card; otherwise return
null . |
Modifier and Type | Method and Description |
---|---|
java.util.List<Card> |
CardCollection.asList()
Return cards as a new list of cards.
|
java.util.Iterator<Card> |
CardCollection.iterator()
An iterator over the cards in this collection.
|
java.util.List<Card> |
GamePlayingStrategy.pickCards(GameBot bot)
Play cards for bot following a certain strategy.
|
Modifier and Type | Method and Description |
---|---|
CardCollection |
CardCollection.addCard(Card card)
Add a single card to this collection.
|
int |
DefaultCardComparator.compare(Card o1,
Card o2)
Card order used in this game.
|
boolean |
CardCollection.containsCard(Card card)
Collection contains this card?
|
CardCollection |
CardCollection.getCardsLargerThan(Card limit)
New collection with same comparator
and only with cards larger than given card
|
CardCollection |
CardCollection.getCardsSmallerThan(Card limit)
New collection with same comparator
and only with cards smaller than given card
|
void |
GameMaster.playCard(java.lang.String nick,
Card card)
Convenience method to play a single card.
|
Card |
CardCollection.takeCard(Card card)
Take a specific card and return it,
if collection has at least one card; otherwise return
null . |
Modifier and Type | Method and Description |
---|---|
CardCollection |
CardCollection.addAllCards(java.util.List<Card> cards)
Add a list of cards to this collection.
|
protected abstract void |
GameMaster.checkCards(java.lang.String nick,
java.util.List<Card> cards)
Check if these cards can be played at this moment.
|
void |
GameMaster.playCards(java.lang.String nick,
java.util.List<Card> cards)
Play your cards.
|
(package private) void |
GameBot.PlayerCards.playedCards(java.util.List<Card> played) |
Constructor and Description |
---|
CardCollection(CardComparator comparator,
java.util.List<Card> cards)
An instance backed by the given
CardComparator
and populated with given list of cards. |
CardCollection(java.util.List<Card> cards)
An instance backed by the by the
DefaultCardComparator
and populated with given list of cards. |
Modifier and Type | Method and Description |
---|---|
java.util.List<Card> |
HeartsGameSimpleStrategy.pickCards(GameBot bot)
Select a collection of cards in hand that:
follow suit (if necessary and possible); don't include hearts,
in the first two rounds.
|
java.util.List<Card> |
HeartsGameStrategy.pickCards(GameBot bot)
Try to select a the highest or lowest card from a collections of
valid cards, taking in consideration the round, the suit to follow,
and the cards already played.
|
Modifier and Type | Method and Description |
---|---|
protected void |
HeartsGameMaster.checkCards(java.lang.String nick,
java.util.List<Card> cards)
In HEARTS the player must play a single card per turn.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Card> |
WarGameStrategy.pickCards(GameBot bot) |
Modifier and Type | Method and Description |
---|---|
protected void |
WarGameMaster.checkCards(java.lang.String nick,
java.util.List<Card> cards)
Normally players play a single card, but in a war they must play 3 cards.
|
Modifier and Type | Field and Description |
---|---|
(package private) java.util.Map<java.lang.String,java.util.List<Card>> |
RealManagerTest.TestPlayers.TestPlayer.cardsOntable |
Modifier and Type | Method and Description |
---|---|
void |
Manager.playCards(java.lang.String gameId,
java.lang.String nick,
java.lang.String password,
java.util.List<Card> cards)
Play cards on a game on behalf of an authenticated user.
|
Modifier and Type | Method and Description |
---|---|
int |
Card.compareTo(Card o) |
Modifier and Type | Method and Description |
---|---|
java.util.List<Card> |
SendCardsEvent.getCards() |
java.util.Map<java.lang.String,java.util.List<Card>> |
RoundUpdateEvent.getCardsOnTable()
Cards on table in this turn for each player.
|
java.util.Map<java.lang.String,java.util.List<Card>> |
RoundConclusionEvent.getCardsOnTable()
Cards on table in this turn for each player.
|
java.util.Map<java.lang.String,java.util.List<Card>> |
GameEndEvent.getCardsOnTable()
Cards on table in this turn for each player.
|
Constructor and Description |
---|
GameEndEvent(java.lang.String gameId,
java.util.Map<java.lang.String,java.util.List<Card>> onTable,
int roundsCompleted,
java.lang.String winner,
java.util.Map<java.lang.String,java.lang.Integer> points)
Create an event for given game to report the winner.
|
RoundConclusionEvent(java.lang.String gameId,
java.util.Map<java.lang.String,java.util.List<Card>> onTable,
int roundsCompleted,
java.util.Map<java.lang.String,java.lang.Integer> points)
Instantiate an event with given data.
|
RoundUpdateEvent(java.lang.String gameId,
java.util.Map<java.lang.String,java.util.List<Card>> onTable,
java.lang.String hasTurn,
int roundsCompleted,
java.lang.String mode)
Instantiate an event with given data.
|
SendCardsEvent(java.lang.String gameId,
java.util.List<Card> cards) |