Making cppcheck even happier.
This commit is contained in:
@@ -30,7 +30,7 @@ CardsValue::~CardsValue()
|
||||
{
|
||||
}
|
||||
|
||||
int CardsValue::holeCardsClass(int one, int two) {
|
||||
int CardsValue::holeCardsClass(int one, int two) const {
|
||||
|
||||
if((one-1)%13<(two-1)%13) {
|
||||
int temp = one;
|
||||
@@ -166,7 +166,7 @@ int CardsValue::holeCardsClass(int one, int two) {
|
||||
|
||||
}
|
||||
|
||||
int CardsValue::holeCardsToIntCode(int* cards) {
|
||||
int CardsValue::holeCardsToIntCode(int* cards) const {
|
||||
|
||||
// Code der HoleCards ermitteln
|
||||
if(cards[0]%13 == cards[1]%13) {
|
||||
@@ -189,7 +189,7 @@ int CardsValue::holeCardsToIntCode(int* cards) {
|
||||
|
||||
}
|
||||
|
||||
int* intCodeToHoleCards(int code) {
|
||||
int* CardsValue::intCodeToHoleCards(int code) const {
|
||||
|
||||
// one possibility !!!
|
||||
|
||||
@@ -207,7 +207,7 @@ int* intCodeToHoleCards(int code) {
|
||||
|
||||
}
|
||||
|
||||
int CardsValue::cardsValue(int* cards, int* position) {
|
||||
int CardsValue::cardsValue(int* cards, int* position) const {
|
||||
|
||||
int array[7][3];
|
||||
int j1, j2, j3, j4, j5, k1, k2, ktemp[3];
|
||||
@@ -586,7 +586,7 @@ int array[7][3];
|
||||
}
|
||||
|
||||
|
||||
vector< vector<int> > CardsValue::calcCardsChance(GameState beRoID, int* playerCards, int* boardCards)
|
||||
vector< vector<int> > CardsValue::calcCardsChance(GameState beRoID, int* playerCards, int* boardCards) const
|
||||
{
|
||||
int i,j;
|
||||
|
||||
|
||||
@@ -34,13 +34,13 @@ public:
|
||||
|
||||
~CardsValue();
|
||||
|
||||
int holeCardsClass(int, int);
|
||||
int cardsValue(int*, int*);
|
||||
int holeCardsClass(int, int) const;
|
||||
int cardsValue(int*, int*) const;
|
||||
|
||||
int holeCardsToIntCode(int*);
|
||||
int* intCodeToHoleCards(int);
|
||||
int holeCardsToIntCode(int*) const;
|
||||
int* intCodeToHoleCards(int) const;
|
||||
|
||||
std::vector< std::vector<int> > calcCardsChance(GameState, int*, int*);
|
||||
std::vector< std::vector<int> > calcCardsChance(GameState, int*, int*) const;
|
||||
//int** showdown(GameState, int**, int);
|
||||
|
||||
};
|
||||
|
||||
@@ -95,7 +95,6 @@ void LocalBeRo::run() {
|
||||
if(!(myHand->getAllInCondition())) {
|
||||
|
||||
PlayerListIterator it_1, it_2;
|
||||
size_t i;
|
||||
|
||||
// running player before smallBlind
|
||||
bool formerRunningPlayerFound = false;
|
||||
@@ -106,7 +105,7 @@ void LocalBeRo::run() {
|
||||
throw LocalException(__FILE__, __LINE__, ERR_ACTIVE_PLAYER_NOT_FOUND);
|
||||
}
|
||||
|
||||
for(i=0; i<myHand->getActivePlayerList()->size(); i++) {
|
||||
for(size_t i=0; i<myHand->getActivePlayerList()->size(); i++) {
|
||||
|
||||
if(it_1 == myHand->getActivePlayerList()->begin()) it_1 = myHand->getActivePlayerList()->end();
|
||||
it_1--;
|
||||
@@ -165,8 +164,6 @@ void LocalBeRo::run() {
|
||||
}
|
||||
}
|
||||
|
||||
int i;
|
||||
|
||||
// prfen, ob aktuelle bero wirklich dran ist
|
||||
if(!firstRound && allHighestSet) {
|
||||
|
||||
@@ -186,7 +183,7 @@ void LocalBeRo::run() {
|
||||
|
||||
myHand->getGuiInterface()->refreshSet();
|
||||
myHand->getGuiInterface()->refreshCash();
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { myHand->getGuiInterface()->refreshAction(i,PLAYER_ACTION_NONE); }
|
||||
for(int i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { myHand->getGuiInterface()->refreshAction(i,PLAYER_ACTION_NONE); }
|
||||
|
||||
myHand->switchRounds();
|
||||
}
|
||||
|
||||
@@ -110,7 +110,6 @@ void LocalBeRoPreflop::run() {
|
||||
|
||||
}
|
||||
|
||||
int i;
|
||||
bool allHighestSet = true;
|
||||
PlayerListConstIterator it_c;
|
||||
|
||||
@@ -152,7 +151,7 @@ void LocalBeRoPreflop::run() {
|
||||
|
||||
getMyHand()->getGuiInterface()->refreshSet();
|
||||
getMyHand()->getGuiInterface()->refreshCash();
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { getMyHand()->getGuiInterface()->refreshAction(i,PLAYER_ACTION_NONE); }
|
||||
for(int i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { getMyHand()->getGuiInterface()->refreshAction(i,PLAYER_ACTION_NONE); }
|
||||
|
||||
getMyHand()->switchRounds();
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ using namespace std;
|
||||
|
||||
LocalBoard::LocalBoard() : BoardInterface(), currentHand(0), pot(0), sets(0)
|
||||
{
|
||||
myCards[0] = myCards[1] = myCards[2] = myCards[3] = myCards[4] = 0;
|
||||
}
|
||||
|
||||
LocalBoard::~LocalBoard()
|
||||
@@ -230,11 +231,11 @@ void LocalBoard::distributePot() {
|
||||
|
||||
if(pot!=0) LOG_ERROR(__FILE__ << " (" << __LINE__ << "): distributePot-ERROR: Pot = " << pot);
|
||||
|
||||
int sum = 0;
|
||||
/*int sum = 0;
|
||||
|
||||
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); it_c++) {
|
||||
sum += (*it_c)->getMyCash();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
void LocalBoard::determinePlayerNeedToShowCards() {
|
||||
|
||||
@@ -4421,7 +4421,6 @@ void LocalPlayer::preflopEngine3() {
|
||||
|
||||
// cout << "nextID " << currentHand->getPlayerArray()[(myID+1)%5]->getMyID() << endl;
|
||||
|
||||
int raise = 0;
|
||||
|
||||
// Bauchgefhl (zufï¿Ålig)
|
||||
int tempRand;
|
||||
@@ -4450,7 +4449,8 @@ void LocalPlayer::preflopEngine3() {
|
||||
else {
|
||||
// RAISE --> wenn hohes Potential
|
||||
if((potential >= 4 && 6 * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet()) || bluff <= 6) {
|
||||
// extrem hohes Potential --> groï¿År Raise
|
||||
int raise = 0;
|
||||
// extrem hohes Potential --> groï¿År Raise
|
||||
if(potential>=6 || bluff <= 2) {
|
||||
|
||||
// bluff - raise
|
||||
@@ -4654,8 +4654,6 @@ void LocalPlayer::flopEngine3() {
|
||||
double percent = (countMy*1.0)/(countAll*1.0);
|
||||
// cout << "Prozent: " << percent << endl;
|
||||
|
||||
int raise = 0;
|
||||
|
||||
// Bauchgefhl (zufï¿Ålig)
|
||||
int tempRand;
|
||||
Tools::getRandNumber((int)(percent*10.)-2,(int)(percent*10.)+2,1,&tempRand,0);
|
||||
@@ -4718,7 +4716,9 @@ void LocalPlayer::flopEngine3() {
|
||||
// RAISE --> wenn Potential besonders gut
|
||||
if((potential >=4 && 2 * tempFold * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet()) || (bluff <= 5 && 4 * tempFold * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet())) {
|
||||
|
||||
// bluff - raise
|
||||
int raise = 0;
|
||||
|
||||
// bluff - raise
|
||||
if(bluff <=5) raise = ((bluff+1)/2) * currentHand->getCurrentBeRo()->getHighestSet();
|
||||
// Betrag, der ber dem aktuell HighestSet gesetzt werden soll
|
||||
else raise = ((potential - 2 ) / 2) * currentHand->getCurrentBeRo()->getHighestSet();
|
||||
@@ -4820,8 +4820,6 @@ void LocalPlayer::turnEngine3() {
|
||||
double percent = (countMy*1.0)/(countAll*1.0);
|
||||
// cout << "Prozent: " << percent << endl;
|
||||
|
||||
int raise;
|
||||
|
||||
// Bauchgefhl (zufï¿Ålig)
|
||||
int tempRand;
|
||||
Tools::getRandNumber((int)(percent*10.)-2,(int)(percent*10.)+2,1,&tempRand,0);
|
||||
@@ -4886,7 +4884,9 @@ void LocalPlayer::turnEngine3() {
|
||||
// RAISE --> wenn Potential besonders gut
|
||||
if((potential >=4 && 2 * tempFold * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet()) || (bluff <= 4 && 3 * tempFold * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet())) {
|
||||
|
||||
// bluff - raise
|
||||
int raise = 0;
|
||||
|
||||
// bluff - raise
|
||||
if(bluff <= 4) raise = ((bluff+1)/2) * currentHand->getCurrentBeRo()->getHighestSet();
|
||||
// Betrag, der ber dem aktuell HighestSet gesetzt werden soll
|
||||
else raise = ( potential - 3 ) * currentHand->getCurrentBeRo()->getHighestSet();
|
||||
@@ -4982,8 +4982,6 @@ void LocalPlayer::riverEngine3() {
|
||||
double percent = (countMy*1.0)/(countAll*1.0);
|
||||
// cout << "Prozent: " << percent << endl;
|
||||
|
||||
int raise;
|
||||
|
||||
// Bauchgefhl (zufï¿Ålig)
|
||||
int tempRand;
|
||||
Tools::getRandNumber((int)(percent*10.)-2,(int)(percent*10.)+2,1,&tempRand,0);
|
||||
@@ -5048,7 +5046,9 @@ void LocalPlayer::riverEngine3() {
|
||||
// RAISE --> wenn Potential besonders gut
|
||||
if((potential >=4 && 2 * tempFold * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet()) || (bluff <= 2 && 4 * tempFold * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet())) {
|
||||
|
||||
// bluff - raise
|
||||
int raise = 0;
|
||||
|
||||
// bluff - raise
|
||||
if(bluff <= 2 ) raise = bluff * currentHand->getCurrentBeRo()->getHighestSet();
|
||||
// Betrag, der ber dem aktuell HighestSet gesetzt werden soll
|
||||
else raise = ( potential - 3 ) * currentHand->getCurrentBeRo()->getHighestSet();
|
||||
|
||||
Reference in New Issue
Block a user