[NEWIMPORT] HandsPlayers.streetXCalls and streetXBets

Pretty sure the bets stat is wrong
This commit is contained in:
Worros 2009-11-25 00:57:14 +08:00
parent 3bb1656603
commit a87a145c28
2 changed files with 43 additions and 13 deletions

View File

@ -1409,7 +1409,17 @@ class Database:
pdata[p]['street2Aggr'], pdata[p]['street2Aggr'],
pdata[p]['street3Aggr'], pdata[p]['street3Aggr'],
pdata[p]['street4Aggr'], pdata[p]['street4Aggr'],
pdata[p]['wonWhenSeenStreet1'] pdata[p]['wonWhenSeenStreet1'],
pdata[p]['street0Calls'],
pdata[p]['street1Calls'],
pdata[p]['street2Calls'],
pdata[p]['street3Calls'],
pdata[p]['street4Calls'],
pdata[p]['street0Bets'],
pdata[p]['street1Bets'],
pdata[p]['street2Bets'],
pdata[p]['street3Bets'],
pdata[p]['street4Bets'],
) ) ) )
q = """INSERT INTO HandsPlayers ( q = """INSERT INTO HandsPlayers (
@ -1439,7 +1449,17 @@ class Database:
street2Aggr, street2Aggr,
street3Aggr, street3Aggr,
street4Aggr, street4Aggr,
wonWhenSeenStreet1 wonWhenSeenStreet1,
street0Calls,
street1Calls,
street2Calls,
street3Calls,
street4Calls,
street0Bets,
street1Bets,
street2Bets,
street3Bets,
street4Bets
) )
VALUES ( VALUES (
%s, %s, %s, %s,
@ -1447,6 +1467,8 @@ class Database:
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s %s, %s, %s, %s, %s
)""" )"""
@ -1493,16 +1515,6 @@ class Database:
# street3CheckCallRaiseDone, # street3CheckCallRaiseDone,
# street4CheckCallRaiseChance, # street4CheckCallRaiseChance,
# street4CheckCallRaiseDone, # street4CheckCallRaiseDone,
# street0Calls,
# street1Calls,
# street2Calls,
# street3Calls,
# street4Calls,
# street0Bets,
# street1Bets,
# street2Bets,
# street3Bets,
# street4Bets
q = q.replace('%s', self.sql.query['placeholder']) q = q.replace('%s', self.sql.query['placeholder'])

View File

@ -46,6 +46,9 @@ class DerivedStats():
self.handsplayers[player[1]]['wonWhenSeenStreet1'] = False self.handsplayers[player[1]]['wonWhenSeenStreet1'] = False
self.handsplayers[player[1]]['sawShowdown'] = False self.handsplayers[player[1]]['sawShowdown'] = False
self.handsplayers[player[1]]['wonAtSD'] = False self.handsplayers[player[1]]['wonAtSD'] = False
for i in range(5):
self.handsplayers[player[1]]['street%dCalls' % i] = 0
self.handsplayers[player[1]]['street%dBets' % i] = 0
self.assembleHands(self.hand) self.assembleHands(self.hand)
self.assembleHandsPlayers(self.hand) self.assembleHandsPlayers(self.hand)
@ -114,6 +117,8 @@ class DerivedStats():
for i, street in enumerate(hand.actionStreets[1:]): for i, street in enumerate(hand.actionStreets[1:]):
self.aggr(self.hand, i) self.aggr(self.hand, i)
self.calls(self.hand, i)
self.bets(self.hand, i)
# Winnings is a non-negative value of money collected from the pot, which already includes the # Winnings is a non-negative value of money collected from the pot, which already includes the
# rake taken out. hand.collectees is Decimal, database requires cents # rake taken out. hand.collectees is Decimal, database requires cents
@ -132,7 +137,6 @@ class DerivedStats():
for player in hand.pot.committed: for player in hand.pot.committed:
self.handsplayers[player]['totalProfit'] = int(self.handsplayers[player]['winnings'] - (100*hand.pot.committed[player])) self.handsplayers[player]['totalProfit'] = int(self.handsplayers[player]['winnings'] - (100*hand.pot.committed[player]))
#default_holecards = ["Xx", "Xx", "Xx", "Xx"] #default_holecards = ["Xx", "Xx", "Xx", "Xx"]
#if hand.gametype['base'] == "hold": #if hand.gametype['base'] == "hold":
# pass # pass
@ -240,6 +244,20 @@ class DerivedStats():
else: else:
self.handsplayers[player[1]]['street%sAggr' % i] = False self.handsplayers[player[1]]['street%sAggr' % i] = False
def calls(self, hand, i):
callers = []
for act in hand.actions[hand.actionStreets[i+1]]:
if act[1] in ('calls'):
self.handsplayers[act[0]]['street%sCalls' % i] = 1 + self.handsplayers[act[0]]['street%sCalls' % i]
# CG - I'm sure this stat is wrong
# Best guess is that raise = 2 bets
def bets(self, hand, i):
betters = []
for act in hand.actions[hand.actionStreets[i+1]]:
if act[1] in ('bets'):
self.handsplayers[act[0]]['street%sBets' % i] = 1 + self.handsplayers[act[0]]['street%sBets' % i]
def countPlayers(self, hand): def countPlayers(self, hand):
pass pass