2007-05-18 17:13:27 +00:00
|
|
|
/***************************************************************************
|
|
|
|
|
* Copyright (C) 2007 by Lothar May *
|
|
|
|
|
* *
|
|
|
|
|
* 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, *
|
2007-05-23 22:31:56 +00:00
|
|
|
` * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
2007-05-18 17:13:27 +00:00
|
|
|
* 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 CLIENTHAND_H
|
|
|
|
|
#define CLIENTHAND_H
|
|
|
|
|
|
|
|
|
|
#include <enginefactory.h>
|
|
|
|
|
#include <guiinterface.h>
|
|
|
|
|
#include <boardinterface.h>
|
|
|
|
|
#include <playerinterface.h>
|
|
|
|
|
#include <handinterface.h>
|
2007-08-04 21:30:20 +00:00
|
|
|
#include <berointerface.h>
|
2007-06-11 17:48:22 +00:00
|
|
|
#include <boost/thread.hpp>
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
2007-05-23 22:31:56 +00:00
|
|
|
class ClientHand : public HandInterface
|
|
|
|
|
{
|
2007-08-06 20:35:26 +00:00
|
|
|
public:
|
2007-09-27 00:37:01 +00:00
|
|
|
ClientHand ( boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, std::vector<boost::shared_ptr<PlayerInterface> >, PlayerList, PlayerList, PlayerList , int, int, int, int, int );
|
2007-08-06 20:35:26 +00:00
|
|
|
~ClientHand();
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
void start();
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-10 23:34:56 +00:00
|
|
|
std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() const;
|
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-08-06 20:35:26 +00:00
|
|
|
BoardInterface* getBoard() const;
|
|
|
|
|
boost::shared_ptr<BeRoInterface> getPreflop() const;
|
|
|
|
|
boost::shared_ptr<BeRoInterface> getFlop() const;
|
|
|
|
|
boost::shared_ptr<BeRoInterface> getTurn() const;
|
|
|
|
|
boost::shared_ptr<BeRoInterface> getRiver() const;
|
|
|
|
|
GuiInterface* getGuiInterface() const;
|
|
|
|
|
boost::shared_ptr<BeRoInterface> getCurrentBeRo() const;
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
void setMyID ( int theValue );
|
|
|
|
|
int getMyID() const;
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
void setActualQuantityPlayers ( int theValue );
|
|
|
|
|
int getActualQuantityPlayers() const;
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
void setStartQuantityPlayers ( int theValue );
|
|
|
|
|
int getStartQuantityPlayers() const;
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
void setActualRound ( int theValue );
|
|
|
|
|
int getActualRound() const;
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
void setDealerPosition ( int theValue );
|
|
|
|
|
int getDealerPosition() const;
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
void setSmallBlind ( int theValue );
|
|
|
|
|
int getSmallBlind() const;
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
void setAllInCondition ( bool theValue );
|
|
|
|
|
bool getAllInCondition() const;
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
void setStartCash ( int theValue );
|
|
|
|
|
int getStartCash() const;
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
void setBettingRoundsPlayed ( int theValue );
|
|
|
|
|
int getBettingRoundsPlayed() const;
|
2007-06-06 21:16:52 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
void setLastPlayersTurn ( int theValue );
|
|
|
|
|
int getLastPlayersTurn() const;
|
|
|
|
|
|
|
|
|
|
void setCardsShown ( bool theValue );
|
|
|
|
|
bool getCardsShown() const;
|
|
|
|
|
|
|
|
|
|
void switchRounds();
|
2007-05-18 17:13:27 +00:00
|
|
|
|
|
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
private:
|
|
|
|
|
mutable boost::recursive_mutex m_syncMutex;
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
boost::shared_ptr<EngineFactory> myFactory;
|
|
|
|
|
GuiInterface *myGui;
|
|
|
|
|
BoardInterface *myBoard;
|
2007-09-23 21:30:51 +00:00
|
|
|
|
2007-09-27 00:37:01 +00:00
|
|
|
std::vector<boost::shared_ptr<PlayerInterface> > playerArray; // delete
|
|
|
|
|
PlayerList seatsList;
|
2007-09-23 21:30:51 +00:00
|
|
|
PlayerList activePlayerList;
|
|
|
|
|
PlayerList runningPlayerList;
|
|
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
int myID;
|
|
|
|
|
int startQuantityPlayers;
|
|
|
|
|
int dealerPosition; // -1 -> neutral
|
|
|
|
|
int actualRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
|
|
|
|
int smallBlind;
|
|
|
|
|
int startCash;
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
int lastPlayersTurn;
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
bool allInCondition;
|
|
|
|
|
bool cardsShown;
|
2007-05-18 17:13:27 +00:00
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
// hier steht bis zu welcher bettingRound der human player gespielt hat: 0 - nur Preflop, 1 - bis Flop, ...
|
|
|
|
|
int bettingRoundsPlayed;
|
2007-05-18 17:13:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|