Removed client code which is no longer needed now. Networking still somewhat broken.
This commit is contained in:
@@ -104,12 +104,8 @@ HEADERS += src/game.h \
|
|||||||
src/engine/local_engine/localbero.h \
|
src/engine/local_engine/localbero.h \
|
||||||
src/engine/network_engine/clientboard.h \
|
src/engine/network_engine/clientboard.h \
|
||||||
src/engine/network_engine/clientenginefactory.h \
|
src/engine/network_engine/clientenginefactory.h \
|
||||||
src/engine/network_engine/clientflop.h \
|
|
||||||
src/engine/network_engine/clienthand.h \
|
src/engine/network_engine/clienthand.h \
|
||||||
src/engine/network_engine/clientplayer.h \
|
src/engine/network_engine/clientplayer.h \
|
||||||
src/engine/network_engine/clientpreflop.h \
|
|
||||||
src/engine/network_engine/clientriver.h \
|
|
||||||
src/engine/network_engine/clientturn.h \
|
|
||||||
src/engine/network_engine/clientbero.h \
|
src/engine/network_engine/clientbero.h \
|
||||||
src/gui/qt/sound/sdlplayer.h \
|
src/gui/qt/sound/sdlplayer.h \
|
||||||
src/gui/qt/mainwindow/mainwindowimpl.h \
|
src/gui/qt/mainwindow/mainwindowimpl.h \
|
||||||
@@ -177,12 +173,8 @@ SOURCES += src/game.cpp \
|
|||||||
src/engine/local_engine/localbero.cpp \
|
src/engine/local_engine/localbero.cpp \
|
||||||
src/engine/network_engine/clientboard.cpp \
|
src/engine/network_engine/clientboard.cpp \
|
||||||
src/engine/network_engine/clientenginefactory.cpp \
|
src/engine/network_engine/clientenginefactory.cpp \
|
||||||
src/engine/network_engine/clientflop.cpp \
|
|
||||||
src/engine/network_engine/clienthand.cpp \
|
src/engine/network_engine/clienthand.cpp \
|
||||||
src/engine/network_engine/clientplayer.cpp \
|
src/engine/network_engine/clientplayer.cpp \
|
||||||
src/engine/network_engine/clientpreflop.cpp \
|
|
||||||
src/engine/network_engine/clientriver.cpp \
|
|
||||||
src/engine/network_engine/clientturn.cpp \
|
|
||||||
src/engine/network_engine/clientbero.cpp \
|
src/engine/network_engine/clientbero.cpp \
|
||||||
src/net/common/connectdata.cpp \
|
src/net/common/connectdata.cpp \
|
||||||
src/net/common/clientcallback.cpp \
|
src/net/common/clientcallback.cpp \
|
||||||
|
|||||||
+2
-8
@@ -76,12 +76,9 @@ HEADERS += src/game.h \
|
|||||||
src/engine/local_engine/tools.h \
|
src/engine/local_engine/tools.h \
|
||||||
src/engine/network_engine/clientboard.h \
|
src/engine/network_engine/clientboard.h \
|
||||||
src/engine/network_engine/clientenginefactory.h \
|
src/engine/network_engine/clientenginefactory.h \
|
||||||
src/engine/network_engine/clientflop.h \
|
|
||||||
src/engine/network_engine/clienthand.h \
|
src/engine/network_engine/clienthand.h \
|
||||||
src/engine/network_engine/clientplayer.h \
|
src/engine/network_engine/clientplayer.h \
|
||||||
src/engine/network_engine/clientpreflop.h \
|
src/engine/network_engine/clientbero.h \
|
||||||
src/engine/network_engine/clientriver.h \
|
|
||||||
src/engine/network_engine/clientturn.h \
|
|
||||||
src/gui/qttoolsinterface.h \
|
src/gui/qttoolsinterface.h \
|
||||||
src/gui/qt/qttools/qttoolswrapper.h \
|
src/gui/qt/qttools/qttoolswrapper.h \
|
||||||
src/gui/qt/qttools/qthelper/qthelper.h \
|
src/gui/qt/qttools/qthelper/qthelper.h \
|
||||||
@@ -117,12 +114,9 @@ SOURCES += src/game.cpp \
|
|||||||
src/engine/local_engine/tools.cpp \
|
src/engine/local_engine/tools.cpp \
|
||||||
src/engine/network_engine/clientboard.cpp \
|
src/engine/network_engine/clientboard.cpp \
|
||||||
src/engine/network_engine/clientenginefactory.cpp \
|
src/engine/network_engine/clientenginefactory.cpp \
|
||||||
src/engine/network_engine/clientflop.cpp \
|
|
||||||
src/engine/network_engine/clienthand.cpp \
|
src/engine/network_engine/clienthand.cpp \
|
||||||
src/engine/network_engine/clientplayer.cpp \
|
src/engine/network_engine/clientplayer.cpp \
|
||||||
src/engine/network_engine/clientpreflop.cpp \
|
src/engine/network_engine/clientbero.cpp \
|
||||||
src/engine/network_engine/clientriver.cpp \
|
|
||||||
src/engine/network_engine/clientturn.cpp \
|
|
||||||
src/net/common/connectdata.cpp \
|
src/net/common/connectdata.cpp \
|
||||||
src/net/common/clientcallback.cpp \
|
src/net/common/clientcallback.cpp \
|
||||||
src/net/common/clientcontext.cpp \
|
src/net/common/clientcontext.cpp \
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// C++ Interface: berointerface
|
// C++ Interface: berointerface
|
||||||
//
|
//
|
||||||
// Description:
|
// Description: Betting rounds interface
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
|
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
|
||||||
@@ -12,6 +12,8 @@
|
|||||||
#ifndef BEROINTERFACE_H
|
#ifndef BEROINTERFACE_H
|
||||||
#define BEROINTERFACE_H
|
#define BEROINTERFACE_H
|
||||||
|
|
||||||
|
#include "game_defs.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@author FThauer FHammer <webmaster@pokerth.net>
|
@author FThauer FHammer <webmaster@pokerth.net>
|
||||||
*/
|
*/
|
||||||
@@ -20,7 +22,7 @@ public:
|
|||||||
|
|
||||||
virtual ~BeRoInterface();
|
virtual ~BeRoInterface();
|
||||||
|
|
||||||
virtual int getMyBeRoID() const =0;
|
virtual GameState getMyBeRoID() const =0;
|
||||||
|
|
||||||
virtual void setPlayersTurn(int) =0;
|
virtual void setPlayersTurn(int) =0;
|
||||||
virtual int getPlayersTurn() const =0;
|
virtual int getPlayersTurn() const =0;
|
||||||
@@ -29,21 +31,13 @@ public:
|
|||||||
virtual int getHighestSet() const =0;
|
virtual int getHighestSet() const =0;
|
||||||
|
|
||||||
virtual void setHighestCardsValue(int theValue) =0;
|
virtual void setHighestCardsValue(int theValue) =0;
|
||||||
virtual void resetFirstRun() =0;
|
|
||||||
virtual int getHighestCardsValue() const =0;
|
virtual int getHighestCardsValue() const =0;
|
||||||
|
|
||||||
virtual void run() =0;
|
virtual void resetFirstRun() =0;
|
||||||
|
|
||||||
// temporary for network
|
|
||||||
virtual void preflopRun() =0;
|
|
||||||
virtual void flopRun() =0;
|
|
||||||
virtual void turnRun() =0;
|
|
||||||
virtual void riverRun() =0;
|
|
||||||
|
|
||||||
virtual void postRiverRun() =0;
|
|
||||||
|
|
||||||
virtual void nextPlayer() =0;
|
virtual void nextPlayer() =0;
|
||||||
|
virtual void run() =0;
|
||||||
|
virtual void postRiverRun() =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
LocalBeRo::LocalBeRo(HandInterface* hi, int id, int qP, int dP, int sB, GameState gS) : BeRoInterface(), myHand(hi), myBeRoID(gS), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstRun(1), firstRound(1), firstHeadsUpRound(1), playersTurn(dP), logBoardCardsDone(0)
|
LocalBeRo::LocalBeRo(HandInterface* hi, int id, int qP, int dP, int sB, GameState gS)
|
||||||
|
: BeRoInterface(), myHand(hi), myBeRoID(gS), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstRun(1), firstRound(1), firstHeadsUpRound(1), playersTurn(dP), logBoardCardsDone(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "game_defs.h"
|
|
||||||
#include "berointerface.h"
|
#include "berointerface.h"
|
||||||
#include "handinterface.h"
|
#include "handinterface.h"
|
||||||
|
|
||||||
@@ -25,15 +24,13 @@
|
|||||||
class LocalBeRo : public BeRoInterface{
|
class LocalBeRo : public BeRoInterface{
|
||||||
public:
|
public:
|
||||||
LocalBeRo(HandInterface* hi, int id, int qP, int dP, int sB, GameState gS);
|
LocalBeRo(HandInterface* hi, int id, int qP, int dP, int sB, GameState gS);
|
||||||
|
|
||||||
~LocalBeRo();
|
~LocalBeRo();
|
||||||
|
|
||||||
int getMyBeRoID() const { return myBeRoID; }
|
GameState getMyBeRoID() const { return myBeRoID; }
|
||||||
|
|
||||||
int getHighestCardsValue() const {return 0;}
|
int getHighestCardsValue() const {return 0;}
|
||||||
void setHighestCardsValue(int theValue) {}
|
void setHighestCardsValue(int theValue) {}
|
||||||
|
|
||||||
|
|
||||||
void setPlayersTurn(int theValue) { playersTurn = theValue; }
|
void setPlayersTurn(int theValue) { playersTurn = theValue; }
|
||||||
int getPlayersTurn() const { return playersTurn; }
|
int getPlayersTurn() const { return playersTurn; }
|
||||||
|
|
||||||
@@ -53,19 +50,13 @@ public:
|
|||||||
|
|
||||||
void nextPlayer();
|
void nextPlayer();
|
||||||
void run();
|
void run();
|
||||||
|
|
||||||
//only until bero refactoring is over
|
|
||||||
void preflopRun() {}
|
|
||||||
void flopRun() {}
|
|
||||||
void riverRun() {}
|
|
||||||
void turnRun() {}
|
|
||||||
void postRiverRun() {}
|
void postRiverRun() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
HandInterface* myHand;
|
HandInterface* myHand;
|
||||||
|
|
||||||
int myBeRoID;
|
const GameState myBeRoID;
|
||||||
int myID;
|
int myID;
|
||||||
int actualQuantityPlayers;
|
int actualQuantityPlayers;
|
||||||
int dealerPosition;
|
int dealerPosition;
|
||||||
|
|||||||
@@ -11,7 +11,8 @@
|
|||||||
//
|
//
|
||||||
#include "clientbero.h"
|
#include "clientbero.h"
|
||||||
|
|
||||||
ClientBeRo::ClientBeRo() : BeRoInterface()
|
ClientBeRo::ClientBeRo(HandInterface* hi, int id, int qP, int dP, int sB, GameState gS)
|
||||||
|
: BeRoInterface(), myHand(hi), highestCardsValue(0), myBeRoID(gS), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstRound(1), playersTurn(dP)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,4 +21,113 @@ ClientBeRo::~ClientBeRo()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GameState
|
||||||
|
ClientBeRo::getMyBeRoID() const
|
||||||
|
{
|
||||||
|
return myBeRoID;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientBeRo::getHighestCardsValue() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return highestCardsValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBeRo::setHighestCardsValue(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
highestCardsValue = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBeRo::setPlayersTurn(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
playersTurn = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientBeRo::getPlayersTurn() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return playersTurn;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBeRo::setHighestSet(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
highestSet = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientBeRo::getHighestSet() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return highestSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBeRo::setFirstRound(bool theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
firstRound = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ClientBeRo::getFirstRound() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return firstRound;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBeRo::setSmallBlindPosition(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
smallBlindPosition = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientBeRo::getSmallBlindPosition() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return smallBlindPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBeRo::setSmallBlind(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
smallBlind = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientBeRo::getSmallBlind() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return smallBlind;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBeRo::resetFirstRun()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBeRo::nextPlayer()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBeRo::run()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBeRo::postRiverRun()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,30 +12,59 @@
|
|||||||
#ifndef CLIENTBERO_H
|
#ifndef CLIENTBERO_H
|
||||||
#define CLIENTBERO_H
|
#define CLIENTBERO_H
|
||||||
|
|
||||||
#include <vector>
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
|
|
||||||
#include "berointerface.h"
|
#include "berointerface.h"
|
||||||
|
|
||||||
|
class HandInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@author FThauer FHammer <webmaster@pokerth.net>
|
@author FThauer FHammer <webmaster@pokerth.net>
|
||||||
*/
|
*/
|
||||||
class ClientBeRo : public BeRoInterface{
|
class ClientBeRo : public BeRoInterface{
|
||||||
public:
|
public:
|
||||||
ClientBeRo();
|
ClientBeRo(HandInterface* hi, int id, int qP, int dP, int sB, GameState gS);
|
||||||
|
|
||||||
~ClientBeRo();
|
~ClientBeRo();
|
||||||
|
|
||||||
int getMyBeRoID() const { return myBeRoID; }
|
GameState getMyBeRoID() const;
|
||||||
|
|
||||||
void run() {}
|
int getHighestCardsValue() const;
|
||||||
|
void setHighestCardsValue(int theValue);
|
||||||
|
|
||||||
protected:
|
void setPlayersTurn(int theValue);
|
||||||
|
int getPlayersTurn() const;
|
||||||
|
|
||||||
int myBeRoID;
|
void setHighestSet(int theValue);
|
||||||
|
int getHighestSet() const;
|
||||||
|
|
||||||
|
void setFirstRound(bool theValue);
|
||||||
|
bool getFirstRound() const;
|
||||||
|
|
||||||
|
void setSmallBlindPosition(int theValue);
|
||||||
|
int getSmallBlindPosition() const;
|
||||||
|
|
||||||
|
void setSmallBlind(int theValue);
|
||||||
|
int getSmallBlind() const;
|
||||||
|
|
||||||
|
void resetFirstRun();
|
||||||
|
|
||||||
|
void nextPlayer();
|
||||||
|
void run();
|
||||||
|
void postRiverRun();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
const GameState myBeRoID;
|
||||||
|
|
||||||
|
mutable boost::recursive_mutex m_syncMutex;
|
||||||
|
|
||||||
|
HandInterface *myHand;
|
||||||
|
|
||||||
|
int highestCardsValue;
|
||||||
|
int playersTurn;
|
||||||
|
int highestSet;
|
||||||
|
bool firstRound;
|
||||||
|
int smallBlindPosition;
|
||||||
|
int smallBlind;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -21,10 +21,7 @@
|
|||||||
#include "clienthand.h"
|
#include "clienthand.h"
|
||||||
#include "clientboard.h"
|
#include "clientboard.h"
|
||||||
#include "clientplayer.h"
|
#include "clientplayer.h"
|
||||||
#include "clientpreflop.h"
|
#include "clientbero.h"
|
||||||
#include "clientflop.h"
|
|
||||||
#include "clientturn.h"
|
|
||||||
#include "clientriver.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -57,15 +54,11 @@ std::vector<boost::shared_ptr<BeRoInterface> > ClientEngineFactory::createBeRo(H
|
|||||||
|
|
||||||
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
||||||
|
|
||||||
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRoPreflop(hi, id, aP, dP, sB)));
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, aP, dP, sB, GAME_STATE_PREFLOP)));
|
||||||
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, aP, dP, sB, GAME_STATE_FLOP)));
|
||||||
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRoFlop(hi, id, aP, dP, sB)));
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, aP, dP, sB, GAME_STATE_TURN)));
|
||||||
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, aP, dP, sB, GAME_STATE_RIVER)));
|
||||||
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRoTurn(hi, id, aP, dP, sB)));
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, aP, dP, sB, GAME_STATE_POST_RIVER)));
|
||||||
|
|
||||||
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRoRiver(hi, id, aP, dP, sB)));
|
|
||||||
|
|
||||||
// myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRoPostRiver(hi, id, aP, dP, sB)));
|
|
||||||
|
|
||||||
return myBeRo;
|
return myBeRo;
|
||||||
|
|
||||||
|
|||||||
@@ -1,122 +0,0 @@
|
|||||||
/***************************************************************************
|
|
||||||
* 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, *
|
|
||||||
* 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. *
|
|
||||||
***************************************************************************/
|
|
||||||
#include "clientflop.h"
|
|
||||||
#include <game_defs.h>
|
|
||||||
#include <handinterface.h>
|
|
||||||
|
|
||||||
//using namespace std;
|
|
||||||
|
|
||||||
ClientBeRoFlop::ClientBeRoFlop(HandInterface* bR, int id, int qP, int dP, int sB)
|
|
||||||
: myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstFlopRun(1), firstFlopRound(1), playersTurn(dP)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ClientBeRoFlop::~ClientBeRoFlop()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoFlop::getMyBeRoID() const
|
|
||||||
{
|
|
||||||
return GAME_STATE_FLOP;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoFlop::setPlayersTurn(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
playersTurn = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoFlop::getPlayersTurn() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return playersTurn;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoFlop::setHighestSet(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
highestSet = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoFlop::getHighestSet() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return highestSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoFlop::setFirstFlopRound(bool theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
firstFlopRound = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
ClientBeRoFlop::getFirstFlopRound() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return firstFlopRound;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoFlop::setSmallBlindPosition(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
smallBlindPosition = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoFlop::getSmallBlindPosition() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return smallBlindPosition;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoFlop::setSmallBlind(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
smallBlind = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoFlop::getSmallBlind() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return smallBlind;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoFlop::resetFirstRun()
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
firstFlopRun = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoFlop::run()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
/***************************************************************************
|
|
||||||
* 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, *
|
|
||||||
* 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 CLIENTFLOP_H
|
|
||||||
#define CLIENTFLOP_H
|
|
||||||
|
|
||||||
#include "berointerface.h"
|
|
||||||
#include <boost/thread.hpp>
|
|
||||||
|
|
||||||
class HandInterface;
|
|
||||||
|
|
||||||
class ClientBeRoFlop : public BeRoInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ClientBeRoFlop(HandInterface*, int, int, int, int);
|
|
||||||
~ClientBeRoFlop();
|
|
||||||
|
|
||||||
int getMyBeRoID() const;
|
|
||||||
|
|
||||||
void setPlayersTurn(int theValue);
|
|
||||||
int getPlayersTurn() const;
|
|
||||||
|
|
||||||
void setHighestSet(int theValue);
|
|
||||||
int getHighestSet() const;
|
|
||||||
|
|
||||||
void setFirstFlopRound(bool theValue);
|
|
||||||
bool getFirstFlopRound() const;
|
|
||||||
|
|
||||||
void setSmallBlindPosition(int theValue);
|
|
||||||
int getSmallBlindPosition() const;
|
|
||||||
|
|
||||||
void setSmallBlind(int theValue);
|
|
||||||
int getSmallBlind() const;
|
|
||||||
|
|
||||||
void setHighestCardsValue(int theValue) {}
|
|
||||||
int getHighestCardsValue() const {return 0;}
|
|
||||||
|
|
||||||
void resetFirstRun();
|
|
||||||
|
|
||||||
void run();
|
|
||||||
|
|
||||||
void preflopRun() {}
|
|
||||||
void flopRun() {}
|
|
||||||
void turnRun() {}
|
|
||||||
void riverRun() {}
|
|
||||||
void postRiverRun() {}
|
|
||||||
|
|
||||||
void nextPlayer() {}
|
|
||||||
|
|
||||||
private:
|
|
||||||
mutable boost::recursive_mutex m_syncMutex;
|
|
||||||
|
|
||||||
HandInterface *myHand;
|
|
||||||
|
|
||||||
int myID;
|
|
||||||
int actualQuantityPlayers;
|
|
||||||
int dealerPosition;
|
|
||||||
int smallBlindPosition;
|
|
||||||
|
|
||||||
int smallBlind;
|
|
||||||
int highestSet;
|
|
||||||
|
|
||||||
bool firstFlopRun;
|
|
||||||
bool firstFlopRound;
|
|
||||||
int playersTurn;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
/***************************************************************************
|
|
||||||
* 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, *
|
|
||||||
* 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. *
|
|
||||||
***************************************************************************/
|
|
||||||
#include "clientpreflop.h"
|
|
||||||
|
|
||||||
#include <handinterface.h>
|
|
||||||
#include <game_defs.h>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
ClientBeRoPreflop::ClientBeRoPreflop(HandInterface* bR, int id, int qP, int dP, int sB)
|
|
||||||
: myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), bigBlindPosition(0), smallBlind(sB), highestSet(2*sB), preflopFirstRound(1), playersTurn(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ClientBeRoPreflop::~ClientBeRoPreflop()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoPreflop::getMyBeRoID() const
|
|
||||||
{
|
|
||||||
return GAME_STATE_PREFLOP;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoPreflop::setPlayersTurn(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
playersTurn = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoPreflop::getPlayersTurn() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return playersTurn;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoPreflop::setHighestSet(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
highestSet = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoPreflop::getHighestSet() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return highestSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoPreflop::resetFirstRun()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoPreflop::run()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
/***************************************************************************
|
|
||||||
* 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, *
|
|
||||||
* 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 CLIENTPREFLOP_H
|
|
||||||
#define CLIENTPREFLOP_H
|
|
||||||
|
|
||||||
#include <berointerface.h>
|
|
||||||
#include <boost/thread.hpp>
|
|
||||||
|
|
||||||
class HandInterface;
|
|
||||||
|
|
||||||
class ClientBeRoPreflop : public BeRoInterface{
|
|
||||||
|
|
||||||
public:
|
|
||||||
ClientBeRoPreflop(HandInterface*, int, int, int, int);
|
|
||||||
~ClientBeRoPreflop();
|
|
||||||
|
|
||||||
int getMyBeRoID() const;
|
|
||||||
|
|
||||||
void setPlayersTurn(int theValue);
|
|
||||||
int getPlayersTurn() const;
|
|
||||||
|
|
||||||
void setHighestSet(int theValue);
|
|
||||||
int getHighestSet() const;
|
|
||||||
|
|
||||||
void setHighestCardsValue(int theValue) {}
|
|
||||||
int getHighestCardsValue() const {return 0;}
|
|
||||||
|
|
||||||
void resetFirstRun();
|
|
||||||
|
|
||||||
void run();
|
|
||||||
|
|
||||||
void preflopRun() {}
|
|
||||||
void flopRun() {}
|
|
||||||
void turnRun() {}
|
|
||||||
void riverRun() {}
|
|
||||||
void postRiverRun() {}
|
|
||||||
|
|
||||||
void nextPlayer() {}
|
|
||||||
|
|
||||||
private:
|
|
||||||
mutable boost::recursive_mutex m_syncMutex;
|
|
||||||
|
|
||||||
HandInterface *myHand;
|
|
||||||
|
|
||||||
int myID;
|
|
||||||
int actualQuantityPlayers;
|
|
||||||
int dealerPosition;
|
|
||||||
int bigBlindPosition;
|
|
||||||
|
|
||||||
int smallBlind;
|
|
||||||
int highestSet;
|
|
||||||
|
|
||||||
bool preflopFirstRound;
|
|
||||||
int playersTurn;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,140 +0,0 @@
|
|||||||
/***************************************************************************
|
|
||||||
* 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, *
|
|
||||||
* 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. *
|
|
||||||
***************************************************************************/
|
|
||||||
#include "clientriver.h"
|
|
||||||
#include <game_defs.h>
|
|
||||||
|
|
||||||
|
|
||||||
//using namespace std;
|
|
||||||
|
|
||||||
ClientBeRoRiver::ClientBeRoRiver(HandInterface* bR, int id, int qP, int dP, int sB)
|
|
||||||
: myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstRiverRun(1), firstRiverRound(1), playersTurn(dP), highestCardsValue(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ClientBeRoRiver::~ClientBeRoRiver()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoRiver::getMyBeRoID() const
|
|
||||||
{
|
|
||||||
return GAME_STATE_RIVER;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoRiver::setPlayersTurn(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
playersTurn = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoRiver::getPlayersTurn() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return playersTurn;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoRiver::setHighestSet(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
highestSet = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoRiver::getHighestSet() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return highestSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoRiver::setFirstRiverRound(bool theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
firstRiverRound = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
ClientBeRoRiver::getFirstRiverRound() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return firstRiverRound;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoRiver::setSmallBlindPosition(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
smallBlindPosition = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoRiver::getSmallBlindPosition() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return smallBlindPosition;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoRiver::setSmallBlind(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
smallBlind = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoRiver::getSmallBlind() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return smallBlind;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoRiver::setHighestCardsValue(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
highestCardsValue = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoRiver::getHighestCardsValue() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return highestCardsValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoRiver::resetFirstRun()
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
firstRiverRun = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoRiver::distributePot()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoRiver::run()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
/***************************************************************************
|
|
||||||
* 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, *
|
|
||||||
* 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 CLIENTRIVER_H
|
|
||||||
#define CLIENTRIVER_H
|
|
||||||
|
|
||||||
#include <berointerface.h>
|
|
||||||
#include <boost/thread.hpp>
|
|
||||||
|
|
||||||
class HandInterface;
|
|
||||||
|
|
||||||
|
|
||||||
class ClientBeRoRiver : public BeRoInterface{
|
|
||||||
public:
|
|
||||||
ClientBeRoRiver(HandInterface*, int, int, int, int);
|
|
||||||
~ClientBeRoRiver();
|
|
||||||
|
|
||||||
int getMyBeRoID() const;
|
|
||||||
|
|
||||||
void setPlayersTurn(int theValue);
|
|
||||||
int getPlayersTurn() const;
|
|
||||||
|
|
||||||
void setHighestSet(int theValue);
|
|
||||||
int getHighestSet() const;
|
|
||||||
|
|
||||||
void setFirstRiverRound(bool theValue);
|
|
||||||
bool getFirstRiverRound() const;
|
|
||||||
|
|
||||||
void setSmallBlindPosition(int theValue);
|
|
||||||
int getSmallBlindPosition() const;
|
|
||||||
|
|
||||||
void setSmallBlind(int theValue);
|
|
||||||
int getSmallBlind() const;
|
|
||||||
|
|
||||||
void setHighestCardsValue(int theValue);
|
|
||||||
int getHighestCardsValue() const;
|
|
||||||
|
|
||||||
void resetFirstRun();
|
|
||||||
|
|
||||||
void distributePot();
|
|
||||||
|
|
||||||
void run();
|
|
||||||
|
|
||||||
void preflopRun() {}
|
|
||||||
void flopRun() {}
|
|
||||||
void turnRun() {}
|
|
||||||
void riverRun() {}
|
|
||||||
void postRiverRun() {}
|
|
||||||
|
|
||||||
void nextPlayer() {}
|
|
||||||
|
|
||||||
private:
|
|
||||||
mutable boost::recursive_mutex m_syncMutex;
|
|
||||||
|
|
||||||
HandInterface *myHand;
|
|
||||||
|
|
||||||
int myID;
|
|
||||||
int actualQuantityPlayers;
|
|
||||||
int dealerPosition;
|
|
||||||
int smallBlindPosition;
|
|
||||||
|
|
||||||
int smallBlind;
|
|
||||||
int highestSet;
|
|
||||||
|
|
||||||
bool firstRiverRun;
|
|
||||||
bool firstRiverRound;
|
|
||||||
int playersTurn;
|
|
||||||
|
|
||||||
int highestCardsValue;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
/***************************************************************************
|
|
||||||
* 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, *
|
|
||||||
* 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. *
|
|
||||||
***************************************************************************/
|
|
||||||
#include "clientturn.h"
|
|
||||||
#include <game_defs.h>
|
|
||||||
#include <handinterface.h>
|
|
||||||
|
|
||||||
//using namespace std;
|
|
||||||
|
|
||||||
ClientBeRoTurn::ClientBeRoTurn(HandInterface* bR, int id, int qP, int dP, int sB)
|
|
||||||
: myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstTurnRun(1), firstTurnRound(1), playersTurn(dP)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ClientBeRoTurn::~ClientBeRoTurn()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoTurn::getMyBeRoID() const
|
|
||||||
{
|
|
||||||
return GAME_STATE_TURN;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoTurn::setPlayersTurn(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
playersTurn = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoTurn::getPlayersTurn() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return playersTurn;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoTurn::setHighestSet(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
highestSet = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoTurn::getHighestSet() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return highestSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoTurn::setFirstTurnRound(bool theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
firstTurnRound = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
ClientBeRoTurn::getFirstTurnRound() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return firstTurnRound;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoTurn::setSmallBlindPosition(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
smallBlindPosition = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoTurn::getSmallBlindPosition() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return smallBlindPosition;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoTurn::setSmallBlind(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
smallBlind = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientBeRoTurn::getSmallBlind() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return smallBlind;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoTurn::resetFirstRun()
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
firstTurnRun = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ClientBeRoTurn::run()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
/***************************************************************************
|
|
||||||
* 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, *
|
|
||||||
* 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 CLIENTTURN_H
|
|
||||||
#define CLIENTTURN_H
|
|
||||||
|
|
||||||
#include <berointerface.h>
|
|
||||||
#include <boost/thread.hpp>
|
|
||||||
|
|
||||||
class HandInterface;
|
|
||||||
|
|
||||||
class ClientBeRoTurn : public BeRoInterface{
|
|
||||||
public:
|
|
||||||
ClientBeRoTurn(HandInterface*, int, int, int, int);
|
|
||||||
~ClientBeRoTurn();
|
|
||||||
|
|
||||||
int getMyBeRoID() const;
|
|
||||||
|
|
||||||
void setPlayersTurn(int theValue);
|
|
||||||
int getPlayersTurn() const;
|
|
||||||
|
|
||||||
void setHighestSet(int theValue);
|
|
||||||
int getHighestSet() const;
|
|
||||||
|
|
||||||
void setFirstTurnRound(bool theValue);
|
|
||||||
bool getFirstTurnRound() const;
|
|
||||||
|
|
||||||
void setSmallBlindPosition(int theValue);
|
|
||||||
int getSmallBlindPosition() const;
|
|
||||||
|
|
||||||
void setSmallBlind(int theValue);
|
|
||||||
int getSmallBlind() const;
|
|
||||||
|
|
||||||
void setHighestCardsValue(int theValue) {}
|
|
||||||
int getHighestCardsValue() const {return 0;}
|
|
||||||
|
|
||||||
void resetFirstRun();
|
|
||||||
|
|
||||||
void run();
|
|
||||||
|
|
||||||
void preflopRun() {}
|
|
||||||
void flopRun() {}
|
|
||||||
void turnRun() {}
|
|
||||||
void riverRun() {}
|
|
||||||
void postRiverRun() {}
|
|
||||||
|
|
||||||
void nextPlayer() {}
|
|
||||||
|
|
||||||
private:
|
|
||||||
mutable boost::recursive_mutex m_syncMutex;
|
|
||||||
|
|
||||||
HandInterface *myHand;
|
|
||||||
|
|
||||||
int myID;
|
|
||||||
int actualQuantityPlayers;
|
|
||||||
int dealerPosition;
|
|
||||||
int smallBlindPosition;
|
|
||||||
|
|
||||||
int smallBlind;
|
|
||||||
int highestSet;
|
|
||||||
|
|
||||||
bool firstTurnRun;
|
|
||||||
bool firstTurnRound;
|
|
||||||
int playersTurn;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -340,7 +340,7 @@ ServerRecvStateInit::InternalProcess(ServerRecvThread &server, SessionWrapper se
|
|||||||
}
|
}
|
||||||
else if (packet->ToNetPacketStartEvent())
|
else if (packet->ToNetPacketStartEvent())
|
||||||
{
|
{
|
||||||
boost::shared_ptr<PlayerData> tmpPlayerData(
|
/*boost::shared_ptr<PlayerData> tmpPlayerData(
|
||||||
new PlayerData(m_curUniquePlayerId++, 0, PLAYER_TYPE_COMPUTER, PLAYER_RIGHTS_NORMAL));
|
new PlayerData(m_curUniquePlayerId++, 0, PLAYER_TYPE_COMPUTER, PLAYER_RIGHTS_NORMAL));
|
||||||
tmpPlayerData->SetName("Computer");
|
tmpPlayerData->SetName("Computer");
|
||||||
|
|
||||||
@@ -354,7 +354,7 @@ ServerRecvStateInit::InternalProcess(ServerRecvThread &server, SessionWrapper se
|
|||||||
static_cast<NetPacketPlayerJoined *>(thisPlayerJoined.get())->SetData(thisPlayerJoinedData);
|
static_cast<NetPacketPlayerJoined *>(thisPlayerJoined.get())->SetData(thisPlayerJoinedData);
|
||||||
server.SendToAllPlayers(thisPlayerJoined);
|
server.SendToAllPlayers(thisPlayerJoined);
|
||||||
|
|
||||||
server.AddComputerPlayer(tmpPlayerData);
|
server.AddComputerPlayer(tmpPlayerData);*/
|
||||||
|
|
||||||
server.InternalStartGame();
|
server.InternalStartGame();
|
||||||
server.SetState(SERVER_START_GAME_STATE::Instance());
|
server.SetState(SERVER_START_GAME_STATE::Instance());
|
||||||
@@ -557,7 +557,7 @@ ServerRecvStateStartRound::Process(ServerRecvThread &server)
|
|||||||
int curRound = curGame.getCurrentHand()->getActualRound();
|
int curRound = curGame.getCurrentHand()->getActualRound();
|
||||||
curGame.getCurrentHand()->switchRounds();
|
curGame.getCurrentHand()->switchRounds();
|
||||||
if (!curGame.getCurrentHand()->getAllInCondition())
|
if (!curGame.getCurrentHand()->getAllInCondition())
|
||||||
GameRun(curGame);
|
curGame.getCurrentHand()->getCurrentBeRo()->run();
|
||||||
int newRound = curGame.getCurrentHand()->getActualRound();
|
int newRound = curGame.getCurrentHand()->getActualRound();
|
||||||
|
|
||||||
// If round changes, deal cards if needed.
|
// If round changes, deal cards if needed.
|
||||||
@@ -714,33 +714,6 @@ ServerRecvStateStartRound::Process(ServerRecvThread &server)
|
|||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
ServerRecvStateStartRound::GameRun(Game &curGame)
|
|
||||||
{
|
|
||||||
// TODO: no switch needed here if game states are polymorphic
|
|
||||||
switch(curGame.getCurrentHand()->getActualRound()) {
|
|
||||||
case GAME_STATE_PREFLOP: {
|
|
||||||
// Preflop starten
|
|
||||||
curGame.getCurrentHand()->getPreflop()->preflopRun();
|
|
||||||
} break;
|
|
||||||
case GAME_STATE_FLOP: {
|
|
||||||
// Flop starten
|
|
||||||
curGame.getCurrentHand()->getFlop()->flopRun();
|
|
||||||
} break;
|
|
||||||
case GAME_STATE_TURN: {
|
|
||||||
// Turn starten
|
|
||||||
curGame.getCurrentHand()->getTurn()->turnRun();
|
|
||||||
} break;
|
|
||||||
case GAME_STATE_RIVER: {
|
|
||||||
// River starten
|
|
||||||
curGame.getCurrentHand()->getRiver()->riverRun();
|
|
||||||
} break;
|
|
||||||
default: {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::list<PlayerInterface *>
|
std::list<PlayerInterface *>
|
||||||
ServerRecvStateStartRound::GetActivePlayers(Game &curGame)
|
ServerRecvStateStartRound::GetActivePlayers(Game &curGame)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -184,7 +184,6 @@ protected:
|
|||||||
// Protected constructor - this is a singleton.
|
// Protected constructor - this is a singleton.
|
||||||
ServerRecvStateStartRound();
|
ServerRecvStateStartRound();
|
||||||
|
|
||||||
static void GameRun(Game &curGame);
|
|
||||||
static std::list<PlayerInterface *> GetActivePlayers(Game &curGame);
|
static std::list<PlayerInterface *> GetActivePlayers(Game &curGame);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user