2011-07-02 14:57:03 +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/>. *
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
2007-11-16 15:24:25 +00:00
|
|
|
#ifndef CLIENTPLAYER_H
|
|
|
|
|
#define CLIENTPLAYER_H
|
|
|
|
|
|
|
|
|
|
#include <playerinterface.h>
|
|
|
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
#include <boost/thread.hpp>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
class ConfigFile;
|
|
|
|
|
class HandInterface;
|
|
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
class ClientPlayer : public PlayerInterface
|
|
|
|
|
{
|
2007-11-16 15:24:25 +00:00
|
|
|
public:
|
2011-01-12 22:33:03 +00:00
|
|
|
ClientPlayer(ConfigFile*, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
|
2007-11-16 15:24:25 +00:00
|
|
|
~ClientPlayer();
|
|
|
|
|
|
2011-01-09 14:16:20 +00:00
|
|
|
void setHand(HandInterface *);
|
2007-11-16 15:24:25 +00:00
|
|
|
|
|
|
|
|
int getMyID() const;
|
2011-09-28 20:20:08 +00:00
|
|
|
void setMyUniqueID(unsigned newId);
|
2007-11-16 15:24:25 +00:00
|
|
|
unsigned getMyUniqueID() const;
|
2011-08-28 17:14:03 +00:00
|
|
|
void setMyGuid(const std::string &theValue);
|
|
|
|
|
std::string getMyGuid() const;
|
2007-11-16 15:24:25 +00:00
|
|
|
PlayerType getMyType() const;
|
|
|
|
|
|
|
|
|
|
void setMyDude(int theValue);
|
|
|
|
|
int getMyDude() const;
|
|
|
|
|
|
|
|
|
|
void setMyDude4(int theValue);
|
|
|
|
|
int getMyDude4() const;
|
|
|
|
|
|
|
|
|
|
void setMyName(const std::string& theValue);
|
|
|
|
|
std::string getMyName() const;
|
|
|
|
|
|
|
|
|
|
void setMyAvatar(const std::string& theValue);
|
|
|
|
|
std::string getMyAvatar() const;
|
|
|
|
|
|
|
|
|
|
void setMyCash(int theValue);
|
|
|
|
|
int getMyCash() const;
|
|
|
|
|
|
|
|
|
|
void setMySet(int theValue);
|
|
|
|
|
void setMySetAbsolute(int theValue);
|
|
|
|
|
void setMySetNull();
|
|
|
|
|
int getMySet() const;
|
|
|
|
|
int getMyLastRelativeSet() const;
|
|
|
|
|
|
2011-10-26 22:29:47 +00:00
|
|
|
void setMyAction(PlayerAction theValue, bool blind);
|
|
|
|
|
PlayerAction getMyAction() const;
|
2007-11-16 15:24:25 +00:00
|
|
|
|
|
|
|
|
void setMyButton(int theValue);
|
|
|
|
|
int getMyButton() const;
|
|
|
|
|
|
|
|
|
|
void setMyActiveStatus(bool theValue);
|
|
|
|
|
bool getMyActiveStatus() const;
|
|
|
|
|
|
2010-09-05 14:33:34 +00:00
|
|
|
void setMyStayOnTableStatus(bool theValue);
|
|
|
|
|
bool getMyStayOnTableStatus() const;
|
2009-04-22 22:32:45 +00:00
|
|
|
|
2007-11-16 15:24:25 +00:00
|
|
|
void setMyCards(int* theValue);
|
|
|
|
|
void getMyCards(int* theValue) const;
|
|
|
|
|
|
|
|
|
|
void setMyTurn(bool theValue);
|
|
|
|
|
bool getMyTurn() const;
|
|
|
|
|
|
|
|
|
|
void setMyCardsFlip(bool theValue, int state);
|
|
|
|
|
bool getMyCardsFlip() const;
|
|
|
|
|
|
|
|
|
|
void setMyCardsValueInt(int theValue);
|
|
|
|
|
int getMyCardsValueInt() const;
|
|
|
|
|
|
2011-11-13 01:05:28 +00:00
|
|
|
void setLogHoleCardsDone(bool theValue);
|
|
|
|
|
bool getLogHoleCardsDone() const;
|
|
|
|
|
|
2007-11-16 15:24:25 +00:00
|
|
|
void setMyBestHandPosition(int* theValue);
|
|
|
|
|
void getMyBestHandPosition(int* theValue) const;
|
|
|
|
|
|
|
|
|
|
void setMyRoundStartCash(int theValue);
|
|
|
|
|
int getMyRoundStartCash() const;
|
|
|
|
|
|
|
|
|
|
void setLastMoneyWon ( int theValue );
|
|
|
|
|
int getLastMoneyWon() const;
|
|
|
|
|
|
|
|
|
|
void setMyAverageSets(int theValue);
|
|
|
|
|
int getMyAverageSets() const;
|
|
|
|
|
|
|
|
|
|
void setMyAggressive(bool theValue);
|
|
|
|
|
int getMyAggressive() const;
|
|
|
|
|
|
|
|
|
|
void setSBluff (int theValue);
|
|
|
|
|
int getSBluff() const;
|
|
|
|
|
|
|
|
|
|
void setSBluffStatus (bool theValue);
|
|
|
|
|
bool getSBluffStatus() const;
|
|
|
|
|
|
|
|
|
|
void action();
|
|
|
|
|
int checkMyAction(int targetAction, int targetBet, int highestSet, int minimumRaise, int smallBlind);
|
|
|
|
|
|
|
|
|
|
void preflopEngine();
|
|
|
|
|
void flopEngine();
|
|
|
|
|
void turnEngine();
|
|
|
|
|
void riverEngine();
|
|
|
|
|
|
|
|
|
|
void preflopEngine3();
|
|
|
|
|
void flopEngine3();
|
|
|
|
|
void turnEngine3();
|
|
|
|
|
void riverEngine3();
|
|
|
|
|
|
|
|
|
|
int preflopCardsValue(int*);
|
|
|
|
|
int flopCardsValue(int*);
|
|
|
|
|
int turnCardsValue(int*);
|
|
|
|
|
|
|
|
|
|
void readFile();
|
|
|
|
|
|
|
|
|
|
void evaluation(int, int);
|
|
|
|
|
|
2011-03-10 19:26:04 +00:00
|
|
|
void setIsConnected(bool connected);
|
|
|
|
|
bool isConnected() const;
|
2011-11-13 14:28:54 +00:00
|
|
|
void setIsKicked(bool kicked);
|
|
|
|
|
bool isKicked() const;
|
2007-11-16 15:24:25 +00:00
|
|
|
|
2010-09-05 14:33:34 +00:00
|
|
|
bool checkIfINeedToShowCards();
|
|
|
|
|
|
2007-11-16 15:24:25 +00:00
|
|
|
private:
|
|
|
|
|
mutable boost::recursive_mutex m_syncMutex;
|
|
|
|
|
|
|
|
|
|
ConfigFile *myConfig;
|
|
|
|
|
HandInterface *currentHand;
|
|
|
|
|
|
|
|
|
|
// Konstanten
|
|
|
|
|
const int myID;
|
2011-09-28 20:20:08 +00:00
|
|
|
unsigned myUniqueID;
|
2011-08-28 17:14:03 +00:00
|
|
|
std::string myGuid;
|
2007-11-16 15:24:25 +00:00
|
|
|
const PlayerType myType;
|
|
|
|
|
std::string myName;
|
|
|
|
|
std::string myAvatar;
|
|
|
|
|
int myDude;
|
|
|
|
|
int myDude4;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Laufvariablen
|
|
|
|
|
int myCardsValueInt;
|
|
|
|
|
int myBestHandPosition[5];
|
|
|
|
|
double myOdds;
|
|
|
|
|
int myNiveau[3];
|
2011-11-13 01:05:28 +00:00
|
|
|
bool logHoleCardsDone;
|
2007-11-16 15:24:25 +00:00
|
|
|
|
|
|
|
|
int myCards[2];
|
|
|
|
|
int myCash;
|
|
|
|
|
int mySet;
|
|
|
|
|
int myLastRelativeSet;
|
2011-10-26 22:29:47 +00:00
|
|
|
PlayerAction myAction;
|
2007-11-16 15:24:25 +00:00
|
|
|
int myButton; // 0 = none, 1 = dealer, 2 =small, 3 = big
|
|
|
|
|
bool myActiveStatus; // 0 = inactive, 1 = active
|
2011-02-11 20:02:08 +00:00
|
|
|
bool myStayOnTableStatus; // 0 = left, 1 = stay
|
2007-11-16 15:24:25 +00:00
|
|
|
bool myTurn; // 0 = no, 1 = yes
|
|
|
|
|
bool myCardsFlip; // 0 = cards are not fliped, 1 = cards are already flipped,
|
|
|
|
|
int myRoundStartCash;
|
|
|
|
|
int lastMoneyWon;
|
|
|
|
|
|
|
|
|
|
int myAverageSets[4];
|
|
|
|
|
bool myAggressive[7];
|
|
|
|
|
|
|
|
|
|
int sBluff;
|
|
|
|
|
bool sBluffStatus;
|
|
|
|
|
|
2011-03-10 19:26:04 +00:00
|
|
|
bool m_isConnected;
|
2011-11-13 14:28:54 +00:00
|
|
|
bool m_isKicked;
|
2007-11-16 15:24:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|