Large diffs are not rendered by default.

@@ -148,11 +148,11 @@ bool Statistics::loadStatistics (const QString path, uint32_t* count_files)
QSqlQuery qu (db);

/* Clear the maps before (re-)loading. */
for (int ii = 0; ii < 4; ++ii) {
for (uint32_t ii = 0; ii < 4; ++ii) {
statMaps[ii].clear ();
}

for (int ii = 0; ii < files.count (); ++ii) {
for (uint32_t ii = 0; ii < files.count (); ++ii) {
db.setDatabaseName (dir.absoluteFilePath (files.at (ii)));
success = db.open ();
if (!success) {
@@ -172,16 +172,16 @@ bool Statistics::loadStatistics (const QString path, uint32_t* count_files)
return false;
}

unsigned int round_ = 6, nbet = 0, betsize = 0;
uint32_t round_ = 6, nbet = 0, betsize = 0;

/* If a player in this round fired a contibet or turnbet. */
unsigned int conbet = 0, turnbet = 0;
uint32_t conbet = 0, turnbet = 0;
smap tmp;
while (qu.next ()) {
unsigned int round = qu.value (0).toInt ();
uint32_t round = qu.value (0).toInt ();
QString player_name = qu.value (1).toString ();
QString player_action = qu.value (2).toString ();
unsigned int amount = qu.value (3).toInt ();
uint32_t amount = qu.value (3).toInt ();

/* New game. */
if (player_action == "starts as dealer") {
@@ -209,18 +209,18 @@ bool Statistics::loadStatistics (const QString path, uint32_t* count_files)
round_ = round;

//tmp[player_name].round_seen[round] = 1;
for (int ir = 0; ir <= round; ++ir) {
for (uint32_t ir = 0; ir <= round; ++ir) {
tmp[player_name].round_seen[ir] = 1;
}
tmp[player_name].observed_hands = 1;

/* When this player is confronted with a contibet. */
if (conbet) {
if ((conbet) && (!tmp[player_name].f_cb)) {
tmp[player_name].f_cbe = 1;
}

/* When this player is confronted with a turnbet. */
if (turnbet) {
if ((turnbet) && (!tmp[player_name].t_2b)) {
tmp[player_name].t_2be = 1;
}

@@ -291,18 +291,18 @@ bool Statistics::loadStatistics (const QString path, uint32_t* count_files)
}

/* If the player folds to a continuation bet. */
if (conbet) {
if ((conbet) && (tmp[player_name].f_cbe)) {
tmp[player_name].f_fc++;
}

/* If the player folds to a turn bet. */
if (turnbet) {
if ((turnbet) && (tmp[player_name].t_2be)) {
tmp[player_name].t_f2++;
}
}

if (player_action == "is all in with") {
for (int ir = 0; ir < 5; ++ir) {
for (uint32_t ir = 0; ir < 5; ++ir) {
tmp[player_name].round_seen[ir] = 1;
}

@@ -359,7 +359,7 @@ bool Statistics::loadStatistics (const QString path, uint32_t* count_files)
}

/* Sum up the maps for different table sizes in the last one for any. */
for (int ii = 0; ii < 3; ++ii) {
for (uint32_t ii = 0; ii < 3; ++ii) {
for (smap::iterator it = statMaps[ii].begin (); it != statMaps[ii].end (); ++it) {
statMaps[ANY][it->first] += it->second;
}
@@ -29,54 +29,76 @@ AnaWidget::~AnaWidget ()

QString AnaWidget::charDescription (const PlayerCharacteristic ps)
{
QString short_desc[7] = {
QString short_desc[9] = {
tr (
"You didn't observe enough hands\n"
"to make a reliable rating."
),
tr (
"In this player's opinion raising is a sin!\n"
"He plays only premium hands.\n"
"You won't get much money out of this player,\n"
"but he won't hurt you either!\n"
"You can usually bluff him a lot.\n"
"If he bets, you better fold unless you got the stone cold nuts."
"If he bets, you better fold unless you got the\n"
"nuts."
),
tr (
"This player is so scared of taking action\n"
"that he would be off with Bingo!\n"
"He just picks up some nice hands and hopes for a hit on the Flop.\n"
"that he would be better off with Bingo!\n"
"He just picks up some nice hands and hopes\n"
"for a hit on the Flop.\n"
"A bluff will succeed often."
),
tr (
"This player has no idea of what Poker is about!\n"
"He plays far too many hands and calls down till the river\n"
"hoping for a miracle!\n"
"He plays far too many hands and calls down till\n"
"the river hoping for a miracle!\n"
"He should be easy to exploit, but don't bluff him!"
),
tr (
"This player actually knows what he's doing!\n"
"He plays only hands which have big potential\n"
"and he knows how to play'em aggressively!\n"
"You should try to avoid getting yourself into a duel with him.\n"
"Though a good bluff might succeed sometimes - But BE CAREFULL!"
"You should try to avoid getting yourself into\n"
"a duel with him. Though a good bluff might\n"
"succeed sometimes - But BE CAREFULL!"
),
tr (
"This guy likes to play many hands aggressively.\n"
"But he seems to be pretty successfull with it,\n"
"so don't consider him a stupid bluffer! Even\n"
"though he's bluffing a lot he actually knows\n"
"what he's doing and he can be a really strong\n"
"opponent. Be carefull and don't get on tilt."
),
tr (
"This guy likes to play many hands aggressively. This can either\n"
"mean that he's a really smart player like Gus Hansen who is specialised\n"
"in crushing TAGs or he's just a wannabe James Bond who wants to show off!\n"
"It's up to you to find out. But you should be carefull with him anyway.\n"
"Don't get on tilt!"
"This guy is a nut, who thinks Poker would be\n"
"about showing off! A wannabe cowboy who is\n"
"regularily overplaying his cards just to not\n"
"look weak! I wonder if he really doesn't notice\n"
"that he's loosing in the long run or whether he\n"
"just doesn't care. However the best you can do\n"
"is just letting him have his fun and get out of\n"
"his way..."
),
tr (
"Well...\n"
"I don't know, what this guys is actually playing,\n"
"but it has not much to do with Texas Hold'em!\n"
"Just get out of his way unless you know what you're doing."
"Just get out of his way unless you know what\n"
"you're doing."
),
tr (
"Okay, this guy's just cracked! He is hyper aggressive\n"
"in a way that can't be profitable. He bets and raises\n"
"like there's no tomorrow! Of course, he is bluffing a lot,\n"
"but it's important that you KEEP CALM. You don't want this\n"
"guy make you push all-in with AK and loose against a pair of threes!\n"
"So just get out of his way and wait until he eliminates himself."
"Okay, this guy's just cracked! He is hyper\n"
"aggressive in a way that can't be profitable.\n"
"He bets and raises like there's no tomorrow!\n"
"Of course, he is bluffing a lot, but it's\n"
"important that you KEEP CALM. You don't want\n"
"this guy to make you push all-in with AK and\n"
"loose against a pair of threes! So just get\n"
"out of his way and wait until he eliminates\n"
"himself."
)
};

@@ -100,78 +122,82 @@ PlayerCharacteristic AnaWidget::analyseChar (const PlayerStat ps, const tableSiz
* >ah | TAG | LAG | Maniac
*
* The borders are the following:
* Fullring: vl = 15%, vh = 25%, al = 0.8, ah = 2.0
* Shorthand: vl = 20%, vh = 35%, al = 1.0, ah = 2.0
* Heads-Up: vl = 50%, vh = 90%, al = 1.5, ah = 5.0
* Fullring: vl = 15%, vh = 25%, al = 0.8, ah = 2.0
* Shorthand: vl = 20%, vh = 35%, al = 1.0, ah = 2.0
* Heads-Up: vl = 50%, vh = 90%, al = 1.5, ah = 5.0
* Any: vl = 22.5%, vh = 35%, al = 1.0, ah = 2.2
*/

const double vl[3] = {15.0, 20.0, 50.0};
const double vh[3] = {25.0, 35.0, 90.0};
const double al[3] = {0.8, 1.0, 1.5};
const double ah[3] = {2.0, 2.0, 5.0};
const double vl[4] = {15.0, 20.0, 50.0, 22.5};
const double vh[4] = {25.0, 35.0, 90.0, 35.0};
const double al[4] = {0.8, 1.0, 1.5, 1.0};
const double ah[4] = {2.0, 2.0, 5.0, 2.2};

/* The char. matrix: */
const PlayerCharacteristic rating[3][3] = {
{P_Rock, P_Weak_Passive, P_Fish},
{P_TAG, P_TAG, P_LAG},
{P_Rock, P_TAG, P_LAG},
{P_TAG, P_LAG, P_Maniac}
};

PlayerCharacteristic pc = P_Fool;

if (ts == ANY) {
uint32_t ar, vr;
if (ps.VPIP () < vl[(int) ts]) {
vr = 0;
} else if (ps.VPIP () > vh[(int) ts]) {
vr = 2;
} else {
uint32_t ar, vr;
if (ps.VPIP () < vl[(int) ts]) {
vr = 0;
} else if (ps.VPIP () > vh[(int) ts]) {
vr = 2;
} else {
vr = 1;
}
if (ps.AF_ave () < al[(int) ts]) {
ar = 0;
} else if (ps.AF_ave () > ah[(int) ts]) {
ar = 2;
} else {
ar = 1;
}
pc = rating[ar][vr];
if (!(isnormal (ps.AF_ave ()) || (ps.AF_ave () == 0.0))) {
pc = P_Fool;
vr = 1;
}

if (ps.AF_ave () < al[(int) ts]) {
ar = 0;
} else if (ps.AF_ave () > ah[(int) ts]) {
ar = 2;
} else {
ar = 1;
}

pc = rating[ar][vr];
if (!(isnormal (ps.AF_ave ()) || (ps.AF_ave () == 0.0))) {
pc = P_Fool;
}

/* Determine whether it's a dump or a successfull LAG. */
if (pc == P_LAG) {
if ((ps.wonPostflop () - ps.wonShowdown ()) < 25.0) {
pc = P_dump_LAG;
}
}

/* The minimum observed hands: */
const uint32_t oh[4] = {100, 100, 75, 120};
if (ps.observed_hands < oh[(int) ts]) {
pc = P_NEData;
}

return pc;
}

void AnaWidget::refresh (const QString pname, tableSize ts)
{
PlayerStat ps = stat->getPlayerStat (pname, ts);

/* The minimum observed hands: */
const uint32_t oh[3] = {1, 1, 75};

if (ps.observed_hands < oh[(int) ts]) {
l_caption->setText (tr ("<font color='#808080'>Too few data!</font>"));
l_short->setText (tr ("You need at least %1 observed hands\nto make a reliable rating.").arg (oh[(int) ts]));
l_tips->setText ("");
} else {
QString caption[7] = {
tr ("<font color='#550055'>Rock</font>"),
tr ("<font color='#800080'>Weak-Passive</font>"),
tr ("<font color='#1000EE'>Fish</font>"),
tr ("<font color='#00FF80'>Shark</font>"),
tr ("<font color='#FF8000'>Loose-Aggressive</font>"),
tr ("<font color='#CCCC00'>Fool</font>"),
tr ("<font color='#FF0000'>Maniac</font>")
};
QString caption[9] = {
tr ("<font color='#808080'>Too few data!</font>"),
tr ("<font color='#550055'>Rock</font>"),
tr ("<font color='#800080'>Weak-Passive</font>"),
tr ("<font color='#1000EE'>Fish</font>"),
tr ("<font color='#00FF80'>Shark</font>"),
tr ("<font color='#FF8000'>Loose-Aggressive</font>"),
tr ("<font color='#559900'>Dump Loose-Aggressive</font>"),
tr ("<font color='#CCCC00'>Fool</font>"),
tr ("<font color='#FF0000'>Maniac</font>")
};

PlayerCharacteristic pc = analyseChar (ps, ts);
PlayerCharacteristic pc = analyseChar (ps, ts);

l_caption->setText (caption[(int) pc]);
l_short->setText (charDescription (pc));
}
l_caption->setText (caption[(int) pc]);
l_short->setText (charDescription (pc));
}
@@ -10,11 +10,13 @@ class QLabel;

enum PlayerCharacteristic
{
P_NEData,
P_Rock,
P_Weak_Passive,
P_Fish,
P_TAG,
P_LAG,
P_dump_LAG,
P_Fool,
P_Maniac
};
@@ -107,16 +107,32 @@ RightPart::RightPart (QWidget *parent)
l_pfr->setCursor (Qt::WhatsThisCursor);
l_pfr->setToolTip (tr ("Percentage of hands the player raised with preflop."));
l_3bet = new QLabel (tr ("3bet:"));
l_3bet->setCursor (Qt::WhatsThisCursor);
l_3bet->setToolTip (tr ("How often the player made a 3bet preflop."));

l_conti = new QLabel (tr ("Continuation Bet:"));
l_conti->setCursor (Qt::WhatsThisCursor);
l_conti->setToolTip (tr ("How often the player fired a continuation bet after a preflop raise."));
l_fconti = new QLabel (tr ("Folded to Contibet:"));
l_fconti->setCursor (Qt::WhatsThisCursor);
l_fconti->setToolTip (tr ("How often the player folded when confronted with a continuation bet."));
l_tbet = new QLabel (tr ("Turn Contibet:"));
l_tbet->setCursor (Qt::WhatsThisCursor);
l_tbet->setToolTip (tr ("How often the player fired another c-bet on the turn after raising preflop."));
l_ftbet = new QLabel (tr ("Folded to Turn C-Bet:"));
l_ftbet->setCursor (Qt::WhatsThisCursor);
l_ftbet->setToolTip (tr ("How often the player folded when confronted with a c-bet on the turn."));

l_fnbet = new QLabel (tr ("Folded to n-Bets:"));
l_fnbet->setCursor (Qt::WhatsThisCursor);
l_fnbet->setToolTip (tr ("How often the opponent folds when confronted with a n-bet."));
l_cr = new QLabel (tr ("Check-Raise:"));
l_cr->setCursor (Qt::WhatsThisCursor);
l_cr->setToolTip (tr ("How many checks are followed by an 2bet."));

l_aAF = new QLabel (tr ("Average AF:"));
l_aAF->setCursor (Qt::WhatsThisCursor);
l_aAF->setToolTip (tr ("AF: Aggression Factor"));
l_fAF = new QLabel (tr ("Flop AF:"));
l_tseen = new QLabel (tr ("Turn seen:"));
l_tseen->setCursor (Qt::WhatsThisCursor);
@@ -131,9 +147,11 @@ RightPart::RightPart (QWidget *parent)
l_wts->setCursor (Qt::WhatsThisCursor);
l_wts->setToolTip (tr ("With how many hands the player went to Showdown <b>after the flop</b>."));
l_wwsf = new QLabel (tr ("W$WSF:"));
l_wwsf->setCursor (Qt::WhatsThisCursor);
l_wwsf->setToolTip (tr ("How often the player won money after he saw the flop."));
l_wsd = new QLabel (tr ("W$SD:"));
l_wsd->setCursor (Qt::WhatsThisCursor);
l_wsd->setToolTip (tr ("How often the player wins by going to Showdown."));
l_wsd->setToolTip (tr ("How often the player wins money by going to Showdown."));

t_obh = new QLabel ("0");
t_vpip = new QLabel ("0");
@@ -36,7 +36,7 @@
MultiView::MultiView (Statistics* PInformation, QWidget* parent)
: QWidget (parent), stat (PInformation)
{
resize (1000, 765);
resize (1000, 786);
setWindowTitle (tr ("Multiplayer view"));

setWindowIcon (QIcon (Global::getInstance ()->getDataDir () + "/PokerTH_Tracker.png"));
@@ -90,12 +90,14 @@ void MultiView::writeTable ()

tableSize ts = (tableSize) c_tsize->currentIndex ();

QString pchar[7] = {
QString pchar[9] = {
tr ("No data..."),
tr ("Rock"),
tr ("Weak-Passive"),
tr ("Fish"),
tr ("Shark"),
tr ("Loose-Aggressive"),
tr ("Dump Loose-Aggressive"),
tr ("Fool"),
tr ("Maniac")
};