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

165 lines
5.1 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 LOCALPLAYER_H
#define LOCALPLAYER_H
2007-01-13 22:29:17 +00:00
#include "playerinterface.h"
2007-01-13 02:40:33 +00:00
#include "cardsvalue.h"
2007-03-06 00:50:35 +00:00
#include "configfile.h"
2007-01-13 02:40:33 +00:00
#include <string>
2007-03-06 00:50:35 +00:00
#include <fstream>
2007-01-13 02:40:33 +00:00
class CardsValue;
2007-01-14 12:15:45 +00:00
class HandInterface;
2007-01-13 22:29:17 +00:00
class BoardInterface;
2007-01-13 02:40:33 +00:00
2007-01-13 22:29:17 +00:00
class LocalPlayer : public PlayerInterface{
2007-01-13 02:40:33 +00:00
public:
2007-03-29 00:15:43 +00:00
LocalPlayer(BoardInterface*, int, std::string, std::string, int, bool, int);
2007-01-13 02:40:33 +00:00
~LocalPlayer();
2007-01-14 12:15:45 +00:00
void setHand(HandInterface*);
2007-01-13 02:40:33 +00:00
void setMyID(const int& theValue) { myID = theValue; }
int getMyID() const { return myID; }
void setMyDude(const int& theValue) { myDude = theValue; }
int getMyDude() const { return myDude; }
void setMyName(const std::string& theValue) { myName = theValue; }
std::string getMyName() const { return myName; }
2007-03-29 00:15:43 +00:00
void setMyAvatar(const std::string& theValue) { myAvatar = theValue; }
std::string getMyAvatar() const { return myAvatar; }
2007-01-13 02:40:33 +00:00
void setMyCash(const int& theValue) { myCash = theValue; }
int getMyCash() const { return myCash; }
void setMySet(const int& theValue) { mySet += theValue; myCash -= theValue; }
void setMySetNull() { mySet = 0; }
int getMySet() const { return mySet;}
void setMyAction(const int& theValue) { myAction = theValue; }
int getMyAction() const { return myAction; }
void setMyButton(const int& theValue) { myButton = theValue; }
int getMyButton() const { return myButton; }
void setMyActiveStatus(bool theValue) { myActiveStatus = theValue; }
bool getMyActiveStatus() const { return myActiveStatus; }
void setMyCards(int* theValue) { int i; for(i=0; i<2; i++) myCards[i] = theValue[i]; }
void getMyCards(int* theValue) { int i; for(i=0; i<2; i++) theValue[i] = myCards[i]; }
void setMyTurn(bool theValue){ myTurn = theValue;}
bool getMyTurn() const{ return myTurn;}
2007-02-28 20:51:43 +00:00
void setMyCardsFlip(bool theValue){ myCardsFlip = theValue;}
bool getMyCardsFlip() const{ return myCardsFlip;}
2007-01-13 02:40:33 +00:00
void setMyCardsValueInt(const int& theValue) { myCardsValueInt = theValue;}
int getMyCardsValueInt() const { return myCardsValueInt; }
2007-01-28 00:17:49 +00:00
int* getMyBestHandPosition() { return myBestHandPosition; }
2007-01-13 02:40:33 +00:00
void setMyRoundStartCash(const int& theValue) { myRoundStartCash = theValue;}
int getMyRoundStartCash() const { return myRoundStartCash; }
2007-03-09 03:53:39 +00:00
void setMyAverageSets(const int& theValue) { myAverageSets[0] = myAverageSets[1]; myAverageSets[1] = myAverageSets[2]; myAverageSets[2] = myAverageSets[3]; myAverageSets[3] = theValue; }
int getMyAverageSets() const { return (myAverageSets[0]+myAverageSets[1]+myAverageSets[2]+myAverageSets[3])/4; }
2007-01-13 02:40:33 +00:00
2007-03-24 00:40:22 +00:00
void setMyAggressive(const bool& theValue) {
int i;
2007-03-28 17:44:22 +00:00
for(i=0; i<6; i++) {
2007-03-24 00:40:22 +00:00
myAggressive[i] = myAggressive[i+1];
}
2007-03-28 17:44:22 +00:00
myAggressive[6] = theValue;
2007-03-24 00:40:22 +00:00
}
int getMyAggressive() const {
int i, sum = 0;
2007-03-28 17:44:22 +00:00
for(i=0; i<7; i++) {
2007-03-24 00:40:22 +00:00
sum += myAggressive[i];
}
return sum;
}
2007-01-13 02:40:33 +00:00
void action();
void preflopEngine();
void flopEngine();
void turnEngine();
void riverEngine();
2007-03-27 17:16:25 +00:00
void preflopEngine3();
void flopEngine3();
void turnEngine3();
void riverEngine3();
int preflopCardsValue(int*);
2007-03-22 23:19:16 +00:00
int flopCardsValue(int*);
2007-03-18 00:14:09 +00:00
int turnCardsValue(int*);
2007-03-17 21:33:46 +00:00
2007-03-27 17:16:25 +00:00
void readFile();
2007-03-27 21:36:56 +00:00
void evaluation(int, int);
2007-03-27 17:16:25 +00:00
2007-01-13 02:40:33 +00:00
private:
2007-01-14 12:15:45 +00:00
HandInterface *actualHand;
2007-01-13 22:29:17 +00:00
BoardInterface *actualBoard;
2007-01-13 02:40:33 +00:00
CardsValue *myCardsValue;
// Konstanten
int myID;
std::string myName;
2007-03-29 00:15:43 +00:00
std::string myAvatar;
2007-01-19 19:13:59 +00:00
int myDude;
2007-03-06 00:50:35 +00:00
int myDude4;
2007-01-19 19:13:59 +00:00
2007-01-13 02:40:33 +00:00
// Laufvariablen
int myCardsValueInt;
2007-01-28 00:17:49 +00:00
int myBestHandPosition[5];
2007-03-27 17:16:25 +00:00
double myOdds;
2007-03-06 00:50:35 +00:00
int myNiveau[3];
int myCards[2];
2007-01-13 02:40:33 +00:00
int myCash;
int mySet;
int myAction; // 0 = none, 1 = fold, 2 = check, 3 = call, 4 = bet, 5 = raise, 6 = allin
int myButton; // 0 = none, 1 = dealer, 2 =small, 3 = big
bool myActiveStatus; // 0 = inactive, 1 = active
bool myTurn; // 0 = no, 1 = yes
2007-02-28 20:51:43 +00:00
bool myCardsFlip; // 0 = cards are not fliped, 1 = cards are already flipped,
2007-01-13 02:40:33 +00:00
int myRoundStartCash;
2007-03-09 03:53:39 +00:00
int myAverageSets[4];
2007-03-28 17:44:22 +00:00
bool myAggressive[7];
2007-01-13 02:40:33 +00:00
};
#endif