[NEWIMPORT] Insert streetXSeen col into HandsPlayers

This commit is contained in:
Worros 2009-11-06 19:13:52 +08:00
parent 5aef7b6054
commit 006d7164ea
2 changed files with 25 additions and 4 deletions

View File

@ -1394,6 +1394,10 @@ class Database:
pdata[p]['startCash'],
pdata[p]['seatNo'],
pdata[p]['winnings'],
pdata[p]['street1Seen'],
pdata[p]['street2Seen'],
pdata[p]['street3Seen'],
pdata[p]['street4Seen'],
pdata[p]['street0Aggr'],
pdata[p]['street1Aggr'],
pdata[p]['street2Aggr'],
@ -1407,6 +1411,10 @@ class Database:
startCash,
seatNo,
winnings,
street1Seen,
street2Seen,
street3Seen,
street4Seen,
street0Aggr,
street1Aggr,
street2Aggr,
@ -1414,6 +1422,7 @@ class Database:
street4Aggr
)
VALUES (
%s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s
)"""
@ -1430,10 +1439,6 @@ class Database:
# street0VPI,
# street0_3BChance,
# street0_3BDone,
# street1Seen,
# street2Seen,
# street3Seen,
# street4Seen,
# sawShowdown,
# otherRaisedStreet1,
# otherRaisedStreet2,

View File

@ -37,7 +37,9 @@ class DerivedStats():
for player in hand.players:
self.handsplayers[player[1]] = {}
#Init vars that may not be used, but still need to be inserted.
# All stud street4 need this when importing holdem
self.handsplayers[player[1]]['winnings'] = 0
self.handsplayers[player[1]]['street4Seen'] = False
self.handsplayers[player[1]]['street4Aggr'] = False
self.assembleHands(self.hand)
@ -106,6 +108,9 @@ class DerivedStats():
for player in hand.collectees:
self.handsplayers[player]['winnings'] = int(100 * hand.collectees[player])
for i, street in enumerate(hand.actionStreets[2:]):
self.seen(self.hand, i+2)
for i, street in enumerate(hand.actionStreets[1:]):
self.aggr(self.hand, i)
@ -849,6 +854,17 @@ class DerivedStats():
self.hands['street3Raises'] = 0 # /* num big bets paid to see sd/street7 */
self.hands['street4Raises'] = 0 # /* num big bets paid to see showdown */
def seen(self, hand, i):
pas = set()
for act in hand.actions[hand.actionStreets[i]]:
pas.add(act[0])
for player in hand.players:
if player[1] in pas:
self.handsplayers[player[1]]['street%sSeen' % i] = True
else:
self.handsplayers[player[1]]['street%sSeen' % i] = False
def aggr(self, hand, i):
aggrers = set()
for act in hand.actions[hand.actionStreets[i]]: