* Filled assembleHandsActions()
This commit is contained in:
parent
a76e34598d
commit
030a15f041
|
@ -216,9 +216,35 @@ class DerivedStats():
|
||||||
# Squeeze, Ratchet?
|
# Squeeze, Ratchet?
|
||||||
|
|
||||||
def assembleHandsActions(self, hand):
|
def assembleHandsActions(self, hand):
|
||||||
print "DEBUG: hand.actions"
|
k = 0
|
||||||
pp.pprint(hand.actions)
|
for i, street in enumerate(hand.actionStreets):
|
||||||
pass
|
for j, act in enumerate(hand.actions[street]):
|
||||||
|
k += 1
|
||||||
|
self.handsactions[k] = {}
|
||||||
|
#default values
|
||||||
|
self.handsactions[k]['amount'] = 0
|
||||||
|
self.handsactions[k]['raiseTo'] = 0
|
||||||
|
self.handsactions[k]['amountCalled'] = 0
|
||||||
|
self.handsactions[k]['numDiscarded'] = 0
|
||||||
|
self.handsactions[k]['cardsDiscarded'] = None
|
||||||
|
self.handsactions[k]['allIn'] = False
|
||||||
|
#Insert values from hand.actions
|
||||||
|
self.handsactions[k]['player'] = act[0]
|
||||||
|
self.handsactions[k]['street'] = i-1
|
||||||
|
self.handsactions[k]['actionNo'] = k
|
||||||
|
self.handsactions[k]['streetActionNo'] = (j+1)
|
||||||
|
self.handsactions[k]['actionId'] = hand.ACTION[act[1]]
|
||||||
|
if act[1] not in ('discards'):
|
||||||
|
self.handsactions[k]['amount'] = int(100 * act[2])
|
||||||
|
if act[1] in ('raises', 'completes'):
|
||||||
|
self.handsactions[k]['raiseTo'] = int(100 * act[3])
|
||||||
|
self.handsactions[k]['amountCalled'] = int(100 * act[4])
|
||||||
|
if act[1] in ('discards'):
|
||||||
|
self.handsactions[k]['numDiscarded'] = int(act[2])
|
||||||
|
if act[1] in ('discards') and len(act) > 3:
|
||||||
|
self.handsactions[k]['cardsDiscarded'] = act[3]
|
||||||
|
if len(act) > 3 and act[1] not in ('discards'):
|
||||||
|
self.handsactions[k]['allIn'] = act[-1]
|
||||||
|
|
||||||
def setPositions(self, hand):
|
def setPositions(self, hand):
|
||||||
"""Sets the position for each player in HandsPlayers
|
"""Sets the position for each player in HandsPlayers
|
||||||
|
|
Loading…
Reference in New Issue
Block a user