one ConfigFile for all
This commit is contained in:
@@ -23,8 +23,8 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
LocalPlayer::LocalPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
|
||||
: PlayerInterface(), actualHand(0), actualBoard(b), myCardsValue(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myAction(0), myButton(mB), myActiveStatus(aS), myTurn(0), myRoundStartCash(0), sBluff(0), sBluffStatus(0)
|
||||
LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
|
||||
: PlayerInterface(), myConfig(c), actualHand(0), actualBoard(b), myCardsValue(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myAction(0), myButton(mB), myActiveStatus(aS), myTurn(0), myRoundStartCash(0), sBluff(0), sBluffStatus(0)
|
||||
{
|
||||
|
||||
// for statistic development
|
||||
@@ -84,12 +84,10 @@ void LocalPlayer::setHand(HandInterface* br) { actualHand = br; }
|
||||
|
||||
void LocalPlayer::action() {
|
||||
|
||||
ConfigFile myConfig;
|
||||
|
||||
switch(actualHand->getActualRound()) {
|
||||
case 0: {
|
||||
|
||||
if(myConfig.readConfigInt("EngineVersion")) preflopEngine3();
|
||||
if(myConfig->readConfigInt("EngineVersion")) preflopEngine3();
|
||||
else preflopEngine();
|
||||
|
||||
actualBoard->collectSets();
|
||||
@@ -98,7 +96,7 @@ void LocalPlayer::action() {
|
||||
} break;
|
||||
case 1: {
|
||||
|
||||
if(myConfig.readConfigInt("EngineVersion")) flopEngine3();
|
||||
if(myConfig->readConfigInt("EngineVersion")) flopEngine3();
|
||||
else flopEngine();
|
||||
|
||||
actualBoard->collectSets();
|
||||
@@ -107,7 +105,7 @@ void LocalPlayer::action() {
|
||||
} break;
|
||||
case 2: {
|
||||
|
||||
if(myConfig.readConfigInt("EngineVersion")) turnEngine3();
|
||||
if(myConfig->readConfigInt("EngineVersion")) turnEngine3();
|
||||
else turnEngine();
|
||||
|
||||
actualBoard->collectSets();
|
||||
@@ -116,7 +114,7 @@ void LocalPlayer::action() {
|
||||
} break;
|
||||
case 3: {
|
||||
|
||||
if(myConfig.readConfigInt("EngineVersion")) riverEngine3();
|
||||
if(myConfig->readConfigInt("EngineVersion")) riverEngine3();
|
||||
else riverEngine();
|
||||
|
||||
actualBoard->collectSets();
|
||||
@@ -810,7 +808,6 @@ void LocalPlayer::flopEngine() {
|
||||
|
||||
void LocalPlayer::turnEngine() {
|
||||
|
||||
ConfigFile myConfig;
|
||||
|
||||
// int tempArray[6];
|
||||
// int boardCards[5];
|
||||
@@ -1057,9 +1054,7 @@ void LocalPlayer::turnEngine() {
|
||||
|
||||
void LocalPlayer::riverEngine() {
|
||||
|
||||
ConfigFile myConfig;
|
||||
|
||||
// int tempArray[6];
|
||||
// int tempArray[6];
|
||||
// int boardCards[5];
|
||||
// int i;
|
||||
|
||||
@@ -2058,7 +2053,6 @@ int LocalPlayer::flopCardsValue(int* cards) {
|
||||
|
||||
void LocalPlayer::readFile() {
|
||||
|
||||
ConfigFile myConfig;
|
||||
int handCode;
|
||||
|
||||
switch(actualHand->getActualRound()) {
|
||||
@@ -2067,7 +2061,7 @@ void LocalPlayer::readFile() {
|
||||
|
||||
handCode = preflopCardsValue(myCards);
|
||||
|
||||
std::string fileName = myConfig.readConfigString("DataDir")+"preflopValues";
|
||||
std::string fileName = myConfig->readConfigString("DataDir")+"preflopValues";
|
||||
|
||||
ifstream fin;
|
||||
|
||||
@@ -2121,7 +2115,7 @@ void LocalPlayer::readFile() {
|
||||
|
||||
// cout << "\t" << handCode << endl;
|
||||
|
||||
std::string fileName = myConfig.readConfigString("DataDir")+"flopValues";
|
||||
std::string fileName = myConfig->readConfigString("DataDir")+"flopValues";
|
||||
|
||||
ifstream fin;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user