2007-01-13 02:40:33 +00:00
|
|
|
/***************************************************************************
|
|
|
|
|
* Copyright (C) 2006 by FThauer FHammer *
|
|
|
|
|
* f.thauer@web.de *
|
|
|
|
|
* *
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
|
* (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
|
* along with this program; if not, write to the *
|
|
|
|
|
* Free Software Foundation, Inc., *
|
|
|
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
|
|
***************************************************************************/
|
2007-05-15 20:37:37 +00:00
|
|
|
#ifndef LOCALHAND_H
|
|
|
|
|
#define LOCALHAND_H
|
2007-01-13 02:40:33 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
|
2007-05-15 20:37:37 +00:00
|
|
|
#include <enginefactory.h>
|
|
|
|
|
#include <guiinterface.h>
|
|
|
|
|
#include <boardinterface.h>
|
|
|
|
|
#include <playerinterface.h>
|
|
|
|
|
#include <handinterface.h>
|
2007-08-04 11:37:26 +00:00
|
|
|
#include <berointerface.h>
|
2007-01-13 14:27:56 +00:00
|
|
|
|
2007-01-13 02:40:33 +00:00
|
|
|
|
2007-01-13 22:29:17 +00:00
|
|
|
class LocalHand : public HandInterface{
|
2007-01-13 02:40:33 +00:00
|
|
|
public:
|
2007-10-19 14:03:12 +00:00
|
|
|
LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, PlayerList, PlayerList, PlayerList, int, int, unsigned, int, int);
|
2007-05-12 22:00:59 +00:00
|
|
|
~LocalHand();
|
|
|
|
|
|
|
|
|
|
void start();
|
2007-01-13 02:40:33 +00:00
|
|
|
|
2007-09-30 00:06:34 +00:00
|
|
|
PlayerList getSeatsList() const {return seatsList;}
|
2007-09-24 10:02:17 +00:00
|
|
|
PlayerList getActivePlayerList() const {return activePlayerList;}
|
|
|
|
|
PlayerList getRunningPlayerList() const {return runningPlayerList;}
|
|
|
|
|
|
2007-09-27 00:37:01 +00:00
|
|
|
PlayerListIterator getSeatIt(unsigned) const;
|
2007-09-26 19:45:58 +00:00
|
|
|
PlayerListIterator getActivePlayerIt(unsigned) const;
|
|
|
|
|
PlayerListIterator getRunningPlayerIt(unsigned) const;
|
|
|
|
|
|
2007-01-13 22:29:17 +00:00
|
|
|
BoardInterface* getBoard() const { return myBoard; }
|
2007-08-07 21:17:11 +00:00
|
|
|
boost::shared_ptr<BeRoInterface> getPreflop() const { return myBeRo[GAME_STATE_PREFLOP]; }
|
|
|
|
|
boost::shared_ptr<BeRoInterface> getFlop() const { return myBeRo[GAME_STATE_FLOP]; }
|
|
|
|
|
boost::shared_ptr<BeRoInterface> getTurn() const { return myBeRo[GAME_STATE_TURN]; }
|
|
|
|
|
boost::shared_ptr<BeRoInterface> getRiver() const { return myBeRo[GAME_STATE_RIVER]; }
|
2007-01-13 02:40:33 +00:00
|
|
|
GuiInterface* getGuiInterface() const { return myGui; }
|
2007-10-18 17:40:12 +00:00
|
|
|
boost::shared_ptr<BeRoInterface> getCurrentBeRo() const { return myBeRo[currentRound]; }
|
2007-01-13 02:40:33 +00:00
|
|
|
|
2007-06-06 21:16:52 +00:00
|
|
|
void setMyID(int theValue) { myID = theValue; }
|
2007-01-13 02:40:33 +00:00
|
|
|
int getMyID() const { return myID; }
|
|
|
|
|
|
2007-06-06 21:16:52 +00:00
|
|
|
void setStartQuantityPlayers(int theValue) { startQuantityPlayers = theValue; }
|
2007-03-05 19:21:41 +00:00
|
|
|
int getStartQuantityPlayers() const { return startQuantityPlayers; }
|
|
|
|
|
|
2007-10-18 17:40:12 +00:00
|
|
|
void setCurrentRound(int theValue) { currentRound = theValue; }
|
|
|
|
|
int getCurrentRound() const { return currentRound; }
|
2007-01-13 02:40:33 +00:00
|
|
|
|
2007-06-06 21:16:52 +00:00
|
|
|
void setDealerPosition(int theValue) { dealerPosition = theValue; }
|
2007-01-13 22:29:17 +00:00
|
|
|
int getDealerPosition() const { return dealerPosition; }
|
|
|
|
|
|
2007-06-06 21:16:52 +00:00
|
|
|
void setSmallBlind(int theValue) { smallBlind = theValue; }
|
2007-01-13 02:40:33 +00:00
|
|
|
int getSmallBlind() const { return smallBlind; }
|
|
|
|
|
|
|
|
|
|
void setAllInCondition(bool theValue) { allInCondition = theValue; }
|
|
|
|
|
bool getAllInCondition() const { return allInCondition; }
|
|
|
|
|
|
2007-06-06 21:16:52 +00:00
|
|
|
void setStartCash(int theValue) { startCash = theValue; }
|
2007-01-13 02:40:33 +00:00
|
|
|
int getStartCash() const { return startCash; }
|
2007-01-28 14:48:18 +00:00
|
|
|
|
2007-06-06 21:16:52 +00:00
|
|
|
void setBettingRoundsPlayed(int theValue) { bettingRoundsPlayed = theValue; }
|
2007-03-09 03:53:39 +00:00
|
|
|
int getBettingRoundsPlayed() const { return bettingRoundsPlayed; }
|
2007-01-28 14:48:18 +00:00
|
|
|
|
2007-06-06 21:16:52 +00:00
|
|
|
void setLastPlayersTurn(int theValue) { lastPlayersTurn = theValue; }
|
2007-03-29 22:58:04 +00:00
|
|
|
int getLastPlayersTurn() const { return lastPlayersTurn; }
|
|
|
|
|
|
2010-07-22 21:17:22 +00:00
|
|
|
void setLastActionPlayer ( unsigned theValue ) { lastActionPlayer = theValue; }
|
|
|
|
|
unsigned getLastActionPlayer() const { return lastActionPlayer; }
|
|
|
|
|
|
2007-06-06 21:16:52 +00:00
|
|
|
void setCardsShown(bool theValue) { cardsShown = theValue; }
|
|
|
|
|
bool getCardsShown() const { return cardsShown; }
|
2007-03-29 22:58:04 +00:00
|
|
|
|
2007-01-13 02:40:33 +00:00
|
|
|
void assignButtons();
|
|
|
|
|
|
|
|
|
|
void switchRounds();
|
2007-01-13 22:29:17 +00:00
|
|
|
|
2007-01-13 02:40:33 +00:00
|
|
|
|
|
|
|
|
private:
|
2007-01-13 14:27:56 +00:00
|
|
|
|
2007-05-18 17:13:27 +00:00
|
|
|
boost::shared_ptr<EngineFactory> myFactory;
|
2007-01-13 02:40:33 +00:00
|
|
|
GuiInterface *myGui;
|
2007-01-13 22:29:17 +00:00
|
|
|
BoardInterface *myBoard;
|
2007-09-23 21:30:51 +00:00
|
|
|
|
2010-07-15 22:37:46 +00:00
|
|
|
PlayerList seatsList; // all player
|
2010-07-22 06:03:11 +00:00
|
|
|
PlayerList activePlayerList; // all player who are not out
|
2010-07-15 22:37:46 +00:00
|
|
|
PlayerList runningPlayerList; // all player who are not folded, not all in and not out
|
2007-09-23 21:30:51 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
2007-01-13 02:40:33 +00:00
|
|
|
|
|
|
|
|
int myID;
|
2007-03-05 19:21:41 +00:00
|
|
|
int startQuantityPlayers;
|
2007-10-19 14:03:12 +00:00
|
|
|
unsigned dealerPosition;
|
2007-10-18 17:40:12 +00:00
|
|
|
int currentRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
2007-01-13 02:40:33 +00:00
|
|
|
int smallBlind;
|
|
|
|
|
int startCash;
|
2007-01-28 14:48:18 +00:00
|
|
|
|
2007-03-29 22:58:04 +00:00
|
|
|
int lastPlayersTurn;
|
2010-07-22 21:17:22 +00:00
|
|
|
unsigned lastActionPlayer;
|
2007-03-29 22:58:04 +00:00
|
|
|
|
2007-01-13 02:40:33 +00:00
|
|
|
bool allInCondition;
|
2007-06-06 21:16:52 +00:00
|
|
|
bool cardsShown;
|
2007-03-09 03:53:39 +00:00
|
|
|
|
|
|
|
|
// hier steht bis zu welcher bettingRound der human player gespielt hat: 0 - nur Preflop, 1 - bis Flop, ...
|
|
|
|
|
int bettingRoundsPlayed;
|
2007-01-13 02:40:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|