public interface Hand extends Serializable
Modifier and Type | Method and Description |
---|---|
void |
bindCard(int slot,
Card card)
Bind a card to a given slot, keeping all known information about it.
|
Card |
getCard(int slot)
Get the card really present in the slot (or null if unknown).
|
CardColour |
getKnownColour(int slot)
Get the known colour of this slot, from the perspective of the player who's hand it is.
|
Integer |
getKnownValue(int slot)
Get the known value of this slot, from the perspective of the player who's hand it is.
|
CardColour[] |
getPossibleColours(int slot)
get possible colours for a given slot.
|
int[] |
getPossibleValues(int slot)
get possible values for a given slot.
|
int |
getSize()
The number of cards which make up this hand.
|
boolean |
hasCard(int slot)
Does the hand contain a card in this slot?
|
boolean |
hasColour(CardColour colour)
Has a card of that colour that it knows exactly about
|
boolean |
hasValue(Integer value)
Has a card of that value that it knows exactly about
|
void |
init()
Initialise all information about the slots.
|
boolean |
isCompletePossible(int slot,
Card card)
Check if this card is possible based on complete infomation.
|
boolean |
isPossible(int slot,
Card card)
check if the card is possible, based on the owner's prespective
|
void |
setCard(int slot,
Card card)
Set a card in a given slot, removing all known information about it.
|
void |
setHasCard(int slot,
boolean value)
Sets whether the hand has a card in this slot.
|
void |
setKnownColour(CardColour colour,
Integer[] slots)
Sets the known colour of a slot from the perspective of the owner.
|
void |
setKnownValue(Integer value,
Integer[] slots)
Sets the known value of a slot from the perspective of the owner.
|
void init()
This should reset any known infomation for any slot in the hand.
Card getCard(int slot)
This is the card which is present in the slot based on information provided by the game itself. This method should always return null for your own hand (agents should not call this method on their own hands).
Agents can use this for accurate information about other player's hands.
slot
- the slot to queryCardColour getKnownColour(int slot)
For this version of the hand class, this is worked out based on explicitly observed tell actions. It will not take into account negative information.
slot
- the slot to queryInteger getKnownValue(int slot)
For this version of the hand class, this is worked out based on explicitly observed tell actions. It will not take into account negative information.
slot
- the slot to queryint getSize()
This can very with game size, and so this should be used whenever you need to iterate over the number of slots in this player's hand.
void setCard(int slot, Card card)
This should be called when a CardDrawn
event occurs in order
to update this hand with the correct information.
It will also reset all known information from the perspective of the owner.
slot
- the slot to updatecard
- the card now residing in this slotvoid bindCard(int slot, Card card)
This has the same basic role as setCard(int, com.fossgalaxy.games.fireworks.state.Card)
but will not remove any information from the owners perspective.
This is mostly useful when using this class as part of a simulation based agent to set the value of the card.
slot
- the slot to updatecard
- the card to assign to that slotvoid setKnownColour(CardColour colour, Integer[] slots)
This method is used to inform the hand about the card from the owner's perspective (tell actions).
colour
- the colour to assign to the slotsslots
- the slots to assign the colour to.void setKnownValue(Integer value, Integer[] slots)
This method is used to inform the hand about the card from the owner's perspective (tell actions).
value
- the value to assign to the slotsslots
- the slots to assign the value to.boolean isCompletePossible(int slot, Card card)
slot
- the slot to checkcard
- the card we are consideringboolean isPossible(int slot, Card card)
slot
- the slot to checkcard
- the card we are consideringint[] getPossibleValues(int slot)
slot
- the slot to checkCardColour[] getPossibleColours(int slot)
slot
- the slot to checkboolean hasColour(CardColour colour)
colour
- The colour to checkboolean hasValue(Integer value)
value
- The value to checkboolean hasCard(int slot)
slot
- The slot to checkvoid setHasCard(int slot, boolean value)
slot
- The slot to setvalue
- The presence or not of a cardCopyright © 2017 FOSS Galaxy. All rights reserved.