This commit is contained in:
@@ -1031,8 +1031,11 @@ ArrayData::~ArrayData()
|
|||||||
|
|
||||||
void ArrayData::getHandChancePreflop(int handCode, int** values) {
|
void ArrayData::getHandChancePreflop(int handCode, int** values) {
|
||||||
|
|
||||||
|
int check = -1;
|
||||||
|
|
||||||
for (unsigned val = 0; val < NUM_HAND_CHANCE_PREFLOP; val++) {
|
for (unsigned val = 0; val < NUM_HAND_CHANCE_PREFLOP; val++) {
|
||||||
if(handCode == handChancePreflop[val].hand) {
|
if(handCode == handChancePreflop[val].hand) {
|
||||||
|
check = 1;
|
||||||
for(int i=0;i<10;i++) {
|
for(int i=0;i<10;i++) {
|
||||||
for(int j=0;j<2;j++) {
|
for(int j=0;j<2;j++) {
|
||||||
values[i][j] = handChancePreflop[val].data[i][j];
|
values[i][j] = handChancePreflop[val].data[i][j];
|
||||||
@@ -1041,6 +1044,6 @@ void ArrayData::getHandChancePreflop(int handCode, int** values) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if (myOdds == -1) LOG_ERROR(__FILE__ << " (" << __LINE__ << "): ERROR myOdds - " << handCode);
|
if (check == -1) LOG_ERROR(__FILE__ << " (" << __LINE__ << "): ERROR getHandChancePreflop - " << handCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
#ifndef ARRAYDATA_H
|
#ifndef ARRAYDATA_H
|
||||||
#define ARRAYDATA_H
|
#define ARRAYDATA_H
|
||||||
|
|
||||||
|
#include <core/loghelper.h>
|
||||||
|
|
||||||
class ArrayData{
|
class ArrayData{
|
||||||
public:
|
public:
|
||||||
ArrayData();
|
ArrayData();
|
||||||
|
|||||||
@@ -572,7 +572,10 @@ int** CardsValue::calcCardsChance(GameState beRoID, int* playerCards, int* board
|
|||||||
int sum = 0;
|
int sum = 0;
|
||||||
|
|
||||||
for(i=0;i<10;i++) {
|
for(i=0;i<10;i++) {
|
||||||
for(j=0;j<2;j++) hand[i][j] = 0;
|
hand[i] = new int[2];
|
||||||
|
for(j=0;j<2;j++) {
|
||||||
|
hand[i][j] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cards[0] = playerCards[0];
|
cards[0] = playerCards[0];
|
||||||
@@ -583,11 +586,12 @@ int** CardsValue::calcCardsChance(GameState beRoID, int* playerCards, int* board
|
|||||||
|
|
||||||
switch(beRoID) {
|
switch(beRoID) {
|
||||||
case GAME_STATE_PREFLOP: {
|
case GAME_STATE_PREFLOP: {
|
||||||
// int rand[5];
|
ArrayData* myArrayData = new ArrayData;
|
||||||
// for(i=0;i<preflopCalcNumber;i++) {
|
|
||||||
// getRandNumber(0,51,5,rand,1,playerCards);
|
myArrayData->getHandChancePreflop(holeCardsToIntCode(playerCards),hand);
|
||||||
//
|
|
||||||
// }
|
delete myArrayData;
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case GAME_STATE_FLOP: {
|
case GAME_STATE_FLOP: {
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#define CARDSVALUE_H
|
#define CARDSVALUE_H
|
||||||
|
|
||||||
#include "game_defs.h"
|
#include "game_defs.h"
|
||||||
|
#include "arraydata.h"
|
||||||
|
|
||||||
class CardsValue{
|
class CardsValue{
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user