exceptions & bugfixes

This commit is contained in:
doitux
2007-09-29 00:08:19 +00:00
parent eec7e6c097
commit fc435f2769
15 changed files with 260 additions and 120 deletions
+1
View File
@@ -21,6 +21,7 @@
#include "handinterface.h"
#include <game_defs.h>
#include "localexception.h"
using namespace std;
@@ -0,0 +1,26 @@
/***************************************************************************
* 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 "localexception.h"
LocalException::~LocalException()
{
}
+35
View File
@@ -0,0 +1,35 @@
/***************************************************************************
* 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. *
***************************************************************************/
/* Exception class for engine errors. */
#ifndef _LOCALEXCEPTION_H_
#define _LOCALEXCEPTION_H_
#include "pokerthexception.h"
class LocalException : public PokerTHException
{
public:
LocalException(int errorId)
: PokerTHException(errorId, 0) {}
virtual ~LocalException();
};
#endif
+22 -22
View File
@@ -112,7 +112,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
case 1: {
tempBoardArray[0] = 27;
/* tempBoardArray[0] = 27;
tempBoardArray[1] = 37;
tempBoardArray[2] = 45;
tempBoardArray[3] = 51;
@@ -124,7 +124,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
tempPlayerAndBoardArray[3] = tempBoardArray[1];
tempPlayerAndBoardArray[4] = tempBoardArray[2];
tempPlayerAndBoardArray[5] = tempBoardArray[3];
tempPlayerAndBoardArray[6] = tempBoardArray[4];
tempPlayerAndBoardArray[6] = tempBoardArray[4];*/
// player0
it = seatsList->begin();
@@ -142,7 +142,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player1
it++;
tempPlayerArray[0] = 12;
/* tempPlayerArray[0] = 12;
tempPlayerArray[1] = 48;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
@@ -150,7 +150,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
(*it)->setMyBestHandPosition(temp5Array);*/
// player2
it++;
@@ -181,28 +181,28 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player4
it++;
tempPlayerArray[0] = 25;
tempPlayerArray[1] = 16;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
// tempPlayerArray[0] = 25;
// tempPlayerArray[1] = 16;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
// (*it)->setMyCards(tempPlayerArray);
// (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
// (*it)->setMyBestHandPosition(temp5Array);
// player5
it++;
tempPlayerArray[0] = 43;
tempPlayerArray[1] = 30;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
// tempPlayerArray[0] = 43;
// tempPlayerArray[1] = 30;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
// (*it)->setMyCards(tempPlayerArray);
// (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
// (*it)->setMyBestHandPosition(temp5Array);
} break;
+18 -10
View File
@@ -860,22 +860,22 @@ LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniq
myCash=0;
} break;
case 1: {
myCash=2520;
myCash=0;
} break;
case 2: {
myCash=0;
myCash=180;
} break;
case 3: {
myCash=0;
myCash=3930;
} break;
case 4: {
myCash=14700;
myCash=0;
} break;
case 5: {
myCash=3780;
myCash=13590;
} break;
case 6: {
myCash=0;
myCash=3300;
} break;
default: {
}
@@ -1202,8 +1202,8 @@ void LocalPlayer::preflopEngine() {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_RAISE;
raise = 3000;
// myAction = PLAYER_ACTION_RAISE;
// raise = 3000;
}
break;
case 2: {
@@ -1246,7 +1246,7 @@ void LocalPlayer::preflopEngine() {
case 3: {
switch(actualHand->getMyID()) {
case 1: {
// myAction = PLAYER_ACTION_FOLD;
myAction = PLAYER_ACTION_FOLD;
// raise = 20;
// if(mySet >= 40) {
// myAction = PLAYER_ACTION_CALL;
@@ -1290,7 +1290,15 @@ void LocalPlayer::preflopEngine() {
}
break;
case 5: {
// myAction = PLAYER_ACTION_FOLD;
if(mySet == 0) {
myAction = PLAYER_ACTION_CALL;
}
}
break;
case 6: {
if(mySet == 160) {
myAction = PLAYER_ACTION_CALL;
}
}
break;
default: {}