game.gamestorage.texas.db
Class SetGameStorageTH_DB

java.lang.Object
  extended by game.gamestorage.texas.db.SetGameStorageTH_DB
All Implemented Interfaces:
IF_SetGameStorage, IF_SetGameStorageTH

public class SetGameStorageTH_DB
extends java.lang.Object
implements IF_SetGameStorageTH

This class is the "java-side" part of the mapping form Java to database
Responsable for writing to db

Author:
Witthold/Korol

Field Summary
(package private)  SetterDBProjector sp
           
 
Constructor Summary
SetGameStorageTH_DB()
           
 
Method Summary
 boolean connectionSuccess()
           
 void setEndCompetition(int[] ranking)
          stores the ranking of the finished competition
 void setEndHand(int finalpot, int[] cashDelta, Card[][] holeCards)
          Stores information of the ending hand (winner, revealed holeCards, ...).
 void setEndRound(long timestamp, java.util.ArrayList<Action> betHistory, Card[] revealedBoardCards)
          Stores information of the ending round.
 int setGetGamedef(int limited, int minBet, int maxBet, int numPlayers, int style, int buyin)
          sets parameters of current challenge - the gamedef gamedef_id is parameter of Estimation constructor
- needed to estimate opponents by completed competitions
- called after instanciating History and before instanciating Estimation
 void setHand(int[] position, int sb, int bb, int ante, int[] cashInit, Card[] holeCards)
          Stores information of the started hand.
 void setStartCompetition(java.lang.String[] players, int[] cash_init)
          stores playernames and there cash when starting competion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sp

SetterDBProjector sp
Constructor Detail

SetGameStorageTH_DB

public SetGameStorageTH_DB()
Method Detail

setGetGamedef

public int setGetGamedef(int limited,
                         int minBet,
                         int maxBet,
                         int numPlayers,
                         int style,
                         int buyin)
Description copied from interface: IF_SetGameStorage
sets parameters of current challenge - the gamedef gamedef_id is parameter of Estimation constructor
- needed to estimate opponents by completed competitions
- called after instanciating History and before instanciating Estimation

Specified by:
setGetGamedef in interface IF_SetGameStorage
Parameters:
limited - - limited:1; pot-limit:0; no-limit: -1
minBet - - only int possible
maxBet - - only int possible
numPlayers - - amount of participating players
style - - cashgame:1; tournament:2; doyle:3;
buyin - - only int possible
Returns:
gamedef_id

setStartCompetition

public void setStartCompetition(java.lang.String[] players,
                                int[] cash_init)
Description copied from interface: IF_SetGameStorage
stores playernames and there cash when starting competion

Specified by:
setStartCompetition in interface IF_SetGameStorage
Parameters:
players - - all participants as String[] playernames
cash_init - - starting credits of every player

setHand

public void setHand(int[] position,
                    int sb,
                    int bb,
                    int ante,
                    int[] cashInit,
                    Card[] holeCards)
Description copied from interface: IF_SetGameStorageTH
Stores information of the started hand.

Specified by:
setHand in interface IF_SetGameStorageTH
Parameters:
position - Position of the player in this hand (0: first player behind the button; 1: second player behind the button; ...) - exact position at table
sb - - smallblind
bb - - bigblind
ante - - forced bet for all players
cashInit - - starting credits of every player
holeCards - - my holeCards as Card[]

setEndRound

public void setEndRound(long timestamp,
                        java.util.ArrayList<Action> betHistory,
                        Card[] revealedBoardCards)
Description copied from interface: IF_SetGameStorageTH
Stores information of the ending round.
(if it is the last round of a hand, setEndHand will be called after this)

Specified by:
setEndRound in interface IF_SetGameStorageTH
Parameters:
timestamp - as unix timestamp
betHistory - - all bets of this round
revealedBoardCards - (if revealed)

setEndHand

public void setEndHand(int finalpot,
                       int[] cashDelta,
                       Card[][] holeCards)
Description copied from interface: IF_SetGameStorageTH
Stores information of the ending hand (winner, revealed holeCards, ...).
(no player actions)

Specified by:
setEndHand in interface IF_SetGameStorageTH
Parameters:
finalpot - - total at the end of the hand
cashDelta - of every player: moneyBefore-moneyAfter
holeCards - - if cards were shown

setEndCompetition

public void setEndCompetition(int[] ranking)
Description copied from interface: IF_SetGameStorage
stores the ranking of the finished competition

Specified by:
setEndCompetition in interface IF_SetGameStorage
Parameters:
ranking - of all participants

connectionSuccess

public boolean connectionSuccess()
Returns:
true, if there is at least one connection to the db