|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbeverbende.CardBase
public class CardBase
Constructor Summary | |
---|---|
CardBase(int nAgents,
java.util.Map<Card.cardKind,java.lang.Integer> cardamount)
Card base constructor |
Method Summary | |
---|---|
void |
changePosition(int[] pos1,
int[] pos2)
Switch the positions of two cards. |
void |
disposeHandCard(int agent)
Removes the 5th card that an agent might still have in his/her hand |
void |
drawFromClosed(int agentID,
int pos)
Draws a card from the closed deck and gives it to the agent (hand). |
void |
drawFromOpen(int agentID)
Draws a card from open deck and gives it to the agent (hand). |
int |
getAgentCardID(int agent,
int position)
|
Card.cardKind |
getAgentCardKind(int agent,
int position)
|
java.lang.String |
getAgentCardKindString(int agent,
int position)
|
int |
getAgentCardValue(int agent,
int position)
|
double |
getAverageCardCount()
|
java.util.Map<Card.cardKind,java.lang.Integer> |
getCardCount()
|
int[] |
getCardPosition(int cardID)
This card can only be in the hand of an agent! |
Card.cardKind |
getHighestCardKind()
|
Card.cardKind |
getLowestCardKind()
|
int |
getNumberOfDifferentCards()
|
void |
putOnOpen(int card)
Puts the given card on the open pile |
Card.cardKind |
seeOpenCard()
|
java.lang.String |
seeOpenCardString()
|
void |
setCardCount(Card.cardKind kind,
int newCardCount)
Changes the number of cards available for a specific value |
void |
setupCards(int numAgents,
java.util.Map<Card.cardKind,java.lang.Integer> cardamount)
Initializes the cards in use and distributes them to the agents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CardBase(int nAgents, java.util.Map<Card.cardKind,java.lang.Integer> cardamount)
nAgents
- the number of agentscardamount
- map containing the amounts of each card in playMethod Detail |
---|
public void setupCards(int numAgents, java.util.Map<Card.cardKind,java.lang.Integer> cardamount)
numAgents
- the number of agentscardamount
- map containing the amounts of each card in playpublic void drawFromClosed(int agentID, int pos)
agentID
- id of the agentpos
- position to put the card onpublic void drawFromOpen(int agentID)
agentID
- id of the agentpublic void putOnOpen(int card)
card
- id of the cardpublic Card.cardKind seeOpenCard()
public void disposeHandCard(int agent)
agent
- id of the agentpublic void changePosition(int[] pos1, int[] pos2)
pos1
- position 1pos2
- position 2public int getAgentCardID(int agent, int position)
agent
- id of the agentposition
- position of the card
public int getAgentCardValue(int agent, int position)
agent
- id of the agentposition
- position of the card
public Card.cardKind getAgentCardKind(int agent, int position)
agent
- id of the agentposition
- position of the card
public int[] getCardPosition(int cardID)
cardID
- id of a card
public int getNumberOfDifferentCards()
public double getAverageCardCount()
public Card.cardKind getHighestCardKind()
public Card.cardKind getLowestCardKind()
public void setCardCount(Card.cardKind kind, int newCardCount)
kind
- card kindnewCardCount
- amount of cards for this card kindpublic java.lang.String getAgentCardKindString(int agent, int position)
agent
- position
-
public java.lang.String seeOpenCardString()
public java.util.Map<Card.cardKind,java.lang.Integer> getCardCount()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |