path to UTF8
configfile split
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "flopinterface.h"
|
||||
#include "turninterface.h"
|
||||
#include "riverinterface.h"
|
||||
#include "session.h"
|
||||
|
||||
|
||||
class EngineFactory{
|
||||
@@ -36,7 +37,7 @@ public:
|
||||
|
||||
virtual HandInterface* createHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int sP, int aP, int dP, int sB,int sC) =0;
|
||||
virtual BoardInterface* createBoard() =0;
|
||||
virtual PlayerInterface* createPlayer(BoardInterface *b, int id, std::string name, std::string avatar, int sC, bool aS, int mB) =0;
|
||||
virtual PlayerInterface* createPlayer(Session*s, BoardInterface *b, int id, std::string name, std::string avatar, int sC, bool aS, int mB) =0;
|
||||
virtual PreflopInterface* createPreflop(HandInterface* hi, int id, int aP, int dP, int sB) =0;
|
||||
virtual FlopInterface* createFlop(HandInterface* hi, int id, int aP, int dP, int sB) =0;
|
||||
virtual TurnInterface* createTurn(HandInterface* hi, int id, int aP, int dP, int sB) =0;
|
||||
|
||||
@@ -35,7 +35,7 @@ HandInterface* LocalEngineFactory::createHand(EngineFactory *f, GuiInterface *g,
|
||||
|
||||
BoardInterface* LocalEngineFactory::createBoard() { return new LocalBoard; }
|
||||
|
||||
PlayerInterface* LocalEngineFactory::createPlayer(BoardInterface *b, int id, std::string name, std::string avatar, int sC, bool aS, int mB) { return new LocalPlayer(b, id, name, avatar, sC, aS, mB); }
|
||||
PlayerInterface* LocalEngineFactory::createPlayer(Session *s, BoardInterface *b, int id, std::string name, std::string avatar, int sC, bool aS, int mB) { return new LocalPlayer(s, b, id, name, avatar, sC, aS, mB); }
|
||||
|
||||
PreflopInterface* LocalEngineFactory::createPreflop(HandInterface* hi, int id, int aP, int dP, int sB) { return new LocalPreflop(hi, id, aP, dP, sB); }
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "localflop.h"
|
||||
#include "localturn.h"
|
||||
#include "localriver.h"
|
||||
#include "session.h"
|
||||
|
||||
class LocalEngineFactory : public EngineFactory
|
||||
{
|
||||
@@ -39,7 +40,7 @@ public:
|
||||
|
||||
HandInterface* createHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int sP, int aP, int dP, int sB,int sC);
|
||||
BoardInterface* createBoard();
|
||||
PlayerInterface* createPlayer(BoardInterface *b, int id, std::string name, std::string avatar, int sC, bool aS, int mB);
|
||||
PlayerInterface* createPlayer(Session *s, BoardInterface *b, int id, std::string name, std::string avatar, int sC, bool aS, int mB);
|
||||
PreflopInterface* createPreflop(HandInterface* hi, int id, int aP, int dP, int sB);
|
||||
FlopInterface* createFlop(HandInterface* hi, int id, int aP, int dP, int sB);
|
||||
TurnInterface* createTurn(HandInterface* hi, int id, int aP, int dP, int sB);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
LocalPlayer::LocalPlayer(BoardInterface *b, int id, std::string name, std::string avatar, int sC, bool aS, int mB) : PlayerInterface(), actualHand(0), actualBoard(b), myCardsValue(0), myID(id), 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(Session *s, BoardInterface *b, int id, std::string name, std::string avatar, int sC, bool aS, int mB) : PlayerInterface(), mySession(s), actualHand(0), actualBoard(b), myCardsValue(0), myConfig(0), myID(id), 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
|
||||
@@ -32,7 +32,9 @@ LocalPlayer::LocalPlayer(BoardInterface *b, int id, std::string name, std::strin
|
||||
// myCash=0;
|
||||
// }
|
||||
////////////////////////////
|
||||
|
||||
|
||||
myConfig = new ConfigFile(mySession->getConfigPath());
|
||||
|
||||
// myBestHandPosition mit -1 initialisieren
|
||||
int i;
|
||||
for(i=0; i<5; i++) {
|
||||
@@ -83,12 +85,11 @@ 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();
|
||||
@@ -97,7 +98,7 @@ void LocalPlayer::action() {
|
||||
} break;
|
||||
case 1: {
|
||||
|
||||
if(myConfig.readConfigInt("EngineVersion")) flopEngine3();
|
||||
if(myConfig->readConfigInt("EngineVersion")) flopEngine3();
|
||||
else flopEngine();
|
||||
|
||||
actualBoard->collectSets();
|
||||
@@ -106,7 +107,7 @@ void LocalPlayer::action() {
|
||||
} break;
|
||||
case 2: {
|
||||
|
||||
if(myConfig.readConfigInt("EngineVersion")) turnEngine3();
|
||||
if(myConfig->readConfigInt("EngineVersion")) turnEngine3();
|
||||
else turnEngine();
|
||||
|
||||
actualBoard->collectSets();
|
||||
@@ -115,7 +116,7 @@ void LocalPlayer::action() {
|
||||
} break;
|
||||
case 3: {
|
||||
|
||||
if(myConfig.readConfigInt("EngineVersion")) riverEngine3();
|
||||
if(myConfig->readConfigInt("EngineVersion")) riverEngine3();
|
||||
else riverEngine();
|
||||
|
||||
actualBoard->collectSets();
|
||||
@@ -809,7 +810,6 @@ void LocalPlayer::flopEngine() {
|
||||
|
||||
void LocalPlayer::turnEngine() {
|
||||
|
||||
ConfigFile myConfig;
|
||||
|
||||
// int tempArray[6];
|
||||
// int boardCards[5];
|
||||
@@ -1056,7 +1056,6 @@ void LocalPlayer::turnEngine() {
|
||||
|
||||
void LocalPlayer::riverEngine() {
|
||||
|
||||
ConfigFile myConfig;
|
||||
|
||||
// int tempArray[6];
|
||||
// int boardCards[5];
|
||||
@@ -2057,7 +2056,6 @@ int LocalPlayer::flopCardsValue(int* cards) {
|
||||
|
||||
void LocalPlayer::readFile() {
|
||||
|
||||
ConfigFile myConfig;
|
||||
int handCode;
|
||||
|
||||
switch(actualHand->getActualRound()) {
|
||||
@@ -2066,7 +2064,7 @@ void LocalPlayer::readFile() {
|
||||
|
||||
handCode = preflopCardsValue(myCards);
|
||||
|
||||
std::string fileName = myConfig.readConfigString("DataDir")+"preflopValues";
|
||||
std::string fileName = myConfig->readConfigString("DataDir")+"preflopValues";
|
||||
|
||||
ifstream fin;
|
||||
|
||||
@@ -2120,7 +2118,7 @@ void LocalPlayer::readFile() {
|
||||
|
||||
// cout << "\t" << handCode << endl;
|
||||
|
||||
std::string fileName = myConfig.readConfigString("DataDir")+"flopValues";
|
||||
std::string fileName = myConfig->readConfigString("DataDir")+"flopValues";
|
||||
|
||||
ifstream fin;
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "cardsvalue.h"
|
||||
|
||||
#include "configfile.h"
|
||||
#include "session.h"
|
||||
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
@@ -36,7 +37,7 @@ class BoardInterface;
|
||||
|
||||
class LocalPlayer : public PlayerInterface{
|
||||
public:
|
||||
LocalPlayer(BoardInterface*, int, std::string, std::string, int, bool, int);
|
||||
LocalPlayer(Session*, BoardInterface*, int, std::string, std::string, int, bool, int);
|
||||
|
||||
~LocalPlayer();
|
||||
|
||||
@@ -140,10 +141,11 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
Session *mySession;
|
||||
HandInterface *actualHand;
|
||||
BoardInterface *actualBoard;
|
||||
|
||||
CardsValue *myCardsValue;
|
||||
ConfigFile *myConfig;
|
||||
|
||||
// Konstanten
|
||||
int myID;
|
||||
|
||||
Reference in New Issue
Block a user