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

121 lines
4.6 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 <vector>
#include <boost/shared_ptr.hpp>
#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:
LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, PlayerInterface**, int, int, int, int, int, int);
~LocalHand();
void start();
2007-01-13 02:40:33 +00:00
2007-01-14 12:15:45 +00:00
PlayerInterface** getPlayerArray() const { return playerArray; }
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; }
boost::shared_ptr<BeRoInterface> getCurrentBeRo() const { return myBeRo[actualRound]; }
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 setActualQuantityPlayers(int theValue) { actualQuantityPlayers = theValue; }
2007-01-13 02:40:33 +00:00
int getActualQuantityPlayers() const { return actualQuantityPlayers; }
void setStartQuantityPlayers(int theValue) { startQuantityPlayers = theValue; }
int getStartQuantityPlayers() const { return startQuantityPlayers; }
void setActualRound(int theValue) { actualRound = theValue; }
2007-01-13 02:40:33 +00:00
int getActualRound() const { return actualRound; }
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 setActivePlayersCounter(int theValue) { activePlayersCounter = theValue; }
int getActivePlayersCounter() const { return activePlayersCounter; }
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; }
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;
PlayerInterface **playerArray;
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
2007-01-13 02:40:33 +00:00
int myID;
int actualQuantityPlayers;
int startQuantityPlayers;
2007-01-13 02:40:33 +00:00
int dealerPosition; // -1 -> neutral
int actualRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
int smallBlind;
int startCash;
2007-03-09 03:53:39 +00:00
int activePlayersCounter;
2007-03-29 22:58:04 +00:00
int lastPlayersTurn;
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