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

130 lines
4.9 KiB
C++
Raw Normal View History

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. *
***************************************************************************/
#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
2007-01-13 22:29:17 +00:00
class LocalHand : public HandInterface{
2007-01-13 02:40:33 +00:00
public:
LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface*, 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;}
PlayerListIterator getSeatIt(unsigned) const;
PlayerListIterator getActivePlayerIt(unsigned) const;
PlayerListIterator getRunningPlayerIt(unsigned) const;
2007-01-13 22:29:17 +00:00
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]; }
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
void setMyID(int theValue) { myID = theValue; }
2007-01-13 02:40:33 +00:00
int getMyID() const { return myID; }
void setStartQuantityPlayers(int theValue) { startQuantityPlayers = theValue; }
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
void setDealerPosition(int theValue) { dealerPosition = theValue; }
2007-01-13 22:29:17 +00:00
int getDealerPosition() const { return dealerPosition; }
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; }
void setStartCash(int theValue) { startCash = theValue; }
2007-01-13 02:40:33 +00:00
int getStartCash() const { return startCash; }
void setBettingRoundsPlayed(int theValue) { bettingRoundsPlayed = theValue; }
2007-03-09 03:53:39 +00:00
int getBettingRoundsPlayed() const { return bettingRoundsPlayed; }
void setLastPlayersTurn(int theValue) { lastPlayersTurn = theValue; }
2007-03-29 22:58:04 +00:00
int getLastPlayersTurn() const { return lastPlayersTurn; }
2011-01-06 22:00:52 +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();
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
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;
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;
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-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