Files
pokerth/src/engine/local_engine/localhand.h
T

197 lines
5.0 KiB
C++
Raw Normal View History

2011-07-03 22:27:36 +00:00
/*****************************************************************************
* PokerTH - The open source texas holdem engine *
* Copyright (C) 2006-2011 Felix Hammer, Florian Thauer, Lothar May *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
#ifndef LOCALHAND_H
#define LOCALHAND_H
2007-01-13 02:40:33 +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
2011-01-03 20:23:34 +00:00
#include <vector>
class Log;
2007-01-13 02:40:33 +00:00
class LocalHand : public HandInterface
{
2007-01-13 02:40:33 +00:00
public:
LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface*, boost::shared_ptr<BoardInterface>, Log*, PlayerList, PlayerList, PlayerList, int, int, unsigned, int, int);
~LocalHand();
void start();
2007-01-13 02:40:33 +00:00
PlayerList getSeatsList() const {
return seatsList;
}
PlayerList getActivePlayerList() const {
return activePlayerList;
}
PlayerList getRunningPlayerList() const {
return runningPlayerList;
}
boost::shared_ptr<BoardInterface> getBoard() const {
return myBoard;
}
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];
}
GuiInterface* getGuiInterface() const {
return myGui;
}
boost::shared_ptr<BeRoInterface> getCurrentBeRo() const {
return myBeRo[currentRound];
}
2007-01-13 02:40:33 +00:00
2011-02-26 10:09:45 +00:00
Log* getLog() const {
return myLog;
}
2011-02-25 21:21:36 +00:00
void setMyID(int theValue) {
myID = theValue;
}
int getMyID() const {
return myID;
}
2007-01-13 02:40:33 +00:00
void setStartQuantityPlayers(int theValue) {
startQuantityPlayers = theValue;
}
int getStartQuantityPlayers() const {
return startQuantityPlayers;
}
2011-10-22 23:57:02 +00:00
void setCurrentRound(GameState theValue) {
currentRound = theValue;
}
2011-10-22 23:57:02 +00:00
GameState getCurrentRound() const {
return currentRound;
}
2007-01-13 02:40:33 +00:00
void setDealerPosition(int theValue) {
dealerPosition = theValue;
}
int getDealerPosition() const {
return dealerPosition;
}
2007-01-13 22:29:17 +00:00
void setSmallBlind(int theValue) {
smallBlind = theValue;
}
int getSmallBlind() const {
return smallBlind;
}
2007-01-13 02:40:33 +00:00
void setAllInCondition(bool theValue) {
allInCondition = theValue;
}
bool getAllInCondition() const {
return allInCondition;
}
2007-01-13 02:40:33 +00:00
void setStartCash(int theValue) {
startCash = theValue;
}
int getStartCash() const {
return startCash;
}
void setBettingRoundsPlayed(int theValue) {
bettingRoundsPlayed = theValue;
}
int getBettingRoundsPlayed() const {
return bettingRoundsPlayed;
}
void setLastPlayersTurn(int theValue) {
lastPlayersTurn = theValue;
}
int getLastPlayersTurn() const {
return lastPlayersTurn;
}
2007-03-29 22:58:04 +00:00
void setLastActionPlayer ( unsigned theValue );
unsigned getLastActionPlayer() const {
return lastActionPlayer;
}
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();
2011-02-26 10:09:45 +00:00
void setBlinds();
2007-01-13 02:40:33 +00:00
void switchRounds();
2007-01-13 22:29:17 +00:00
2011-01-12 23:35:45 +00:00
protected:
PlayerListIterator getSeatIt(unsigned) const;
PlayerListIterator getActivePlayerIt(unsigned) const;
PlayerListIterator getRunningPlayerIt(unsigned) const;
2007-01-13 02:40:33 +00:00
private:
2007-01-13 14:27:56 +00:00
boost::shared_ptr<EngineFactory> myFactory;
2007-01-13 02:40:33 +00:00
GuiInterface *myGui;
boost::shared_ptr<BoardInterface> myBoard;
Log *myLog;
2007-09-23 21:30:51 +00:00
PlayerList seatsList; // all player
PlayerList activePlayerList; // all player who are not out
PlayerList runningPlayerList; // all player who are not folded, not all in and not out
2007-09-23 21:30:51 +00:00
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
2007-01-13 02:40:33 +00:00
int myID;
int startQuantityPlayers;
unsigned dealerPosition;
unsigned smallBlindPosition;
unsigned bigBlindPosition;
2011-10-22 23:57:02 +00:00
GameState currentRound;
2007-01-13 02:40:33 +00:00
int smallBlind;
int startCash;
2007-03-29 22:58:04 +00:00
int lastPlayersTurn;
unsigned lastActionPlayer;
2007-03-29 22:58:04 +00:00
2007-01-13 02:40:33 +00:00
bool allInCondition;
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