|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectextmodule.ExtProposalMC
public class ExtProposalMC
This class is a wrapper class to use the shared library MC. It converts specified interface for external proposals into the protocol the library expects.
Field Summary | |
---|---|
private int[] |
bets
|
private java.util.ArrayList<Card> |
boardCards
|
private int[] |
cashs
|
private boolean |
dealer
|
private java.util.ArrayList<ActionMC> |
handHistory
|
private Card[][] |
holeCards
|
Constructor Summary | |
---|---|
ExtProposalMC()
|
Method Summary | |
---|---|
private int |
convertCard(Card card)
Returns the given card converted into another format. |
private int |
convertCard(int suit,
int rank)
Returns the given card converted into another format. |
int |
getBoardCard(int i)
Returns the board card revealed as the indexed card. |
private int |
getNextAction(int player2_chips,
boolean dealer)
|
int |
getNumActions()
Returns the amount of actions in the gameStorage. |
int |
getNumBoardCards()
Returns the amount of board cards. |
char |
getOption(int i)
Returns the type of the move with the given index. |
int |
getProposal()
Returns the proposal for an action. |
int |
getValue(int i)
Returns the value of the move with the given index. |
private boolean |
init()
|
boolean |
initModule(int[] betSizes,
int[] betStructure,
int[] blindStructure,
int ante,
java.lang.String playerNames,
int[] cashOfPlayer)
Tries to initialize the module. |
void |
newAction(Action action)
Informs the module about a new action. |
void |
newHand(int button)
Informs the module about the beginning of a new hand. |
void |
newHoleCards(int player,
int[] cardsAsInt)
Informs the module about new hole cards of a player. |
void |
newRound(int round,
int[] newCards)
Informs the module about a new round. |
private void |
setCards(int c1,
int c2)
|
private void |
setChips(int init_cash)
|
void |
showdown(int player,
int gain)
Informs the module about the showdown of the hand. |
private void |
showResult(boolean dealer,
int card1,
int card2)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.ArrayList<ActionMC> handHistory
private Card[][] holeCards
private java.util.ArrayList<Card> boardCards
private int[] cashs
private int[] bets
private boolean dealer
Constructor Detail |
---|
public ExtProposalMC()
Method Detail |
---|
private boolean init()
private void setChips(int init_cash)
private void setCards(int c1, int c2)
private void showResult(boolean dealer, int card1, int card2)
private int getNextAction(int player2_chips, boolean dealer)
public boolean initModule(int[] betSizes, int[] betStructure, int[] blindStructure, int ante, java.lang.String playerNames, int[] cashOfPlayer)
IF_ExtModule_Feed
initModule
in interface IF_ExtModule_Feed
betStructure
- The limits for each betting round (0 for no limit)blindStructure
- The blind sizes for the players after the buttonante
- The ante for each playerplayerNames
- The player names in the table order. The name at index 0 is the own namecashOfPlayer
- The initial cash of the players.
public void newHand(int button)
IF_ExtModule_Feed
newHand
in interface IF_ExtModule_Feed
public void newHoleCards(int player, int[] cardsAsInt)
IF_ExtModule_Feed
newHoleCards
in interface IF_ExtModule_Feed
public void newAction(Action action)
IF_ExtModule_Feed
newAction
in interface IF_ExtModule_Feed
public void newRound(int round, int[] newCards)
IF_ExtModule_Feed
newRound
in interface IF_ExtModule_Feed
public void showdown(int player, int gain)
IF_ExtModule_Feed
showdown
in interface IF_ExtModule_Feed
public int getProposal()
IF_ExtModule_GetProposal
getProposal
in interface IF_ExtModule_GetProposal
public int getNumActions()
public char getOption(int i)
i
- index of the move
public int getValue(int i)
i
- index of the move
public int getNumBoardCards()
public int getBoardCard(int i)
private int convertCard(Card card)
private int convertCard(int suit, int rank)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |