def decode(cls, obj): return cls( obj["TableId"], obj['NoSeat'], obj['FaceUpCards'], obj['FaceDownCards'], PlayerStateEnum.parse(obj['PlayerState']) )
def __str__(self): return '{0} ({1} [{2}] [{3}] {4})'.format( super().__str__(), self.no_seat, ', '.join(self.face_up_cards), ', '.join(self.face_down_cards), PlayerStateEnum.to_string(self.player_state) )
def _encode_specific(self, d): super()._encode_specific(d) d['NoSeat'] = self.no_seat d['TotalPlayedMoneyAmount'] = self.total_played_money_amount d['TotalSafeMoneyAmount'] = self.total_safe_money_amount d['TotalPot'] = self.total_pot d['ActionTakenType'] = GameActionEnum.to_string(self.action_taken_type) d['ActionTakenAmount'] = self.action_taken_amount d['PlayerState'] = PlayerStateEnum.to_string(self.player_state)
def encode(self): d = OrderedDict() d['NoSeat'] = self.no_seat d['Name'] = self.name d['MoneySafeAmnt'] = self.money_safe_amount d['MoneyBetAmnt'] = self.money_bet_amount d['FaceUpCards'] = self.face_up_cards d['FaceDownCards'] = self.face_down_cards d['State'] = PlayerStateEnum.to_string(self.state) return d
def __str__(self): return '{0}:{1} {2}/{3} [{4} | {5}] {6}'.format( self.no_seat, self.name, self.money_bet_amount, self.money_safe_amount, ', '.join(self.face_up_cards), ', '.join(self.face_down_cards), PlayerStateEnum.to_string(self.state) )
def decode(cls, obj): return cls( obj["TableId"], obj["NoSeat"], obj["TotalPlayedMoneyAmount"], obj["TotalSafeMoneyAmount"], obj["TotalPot"], GameActionEnum.parse(obj['ActionTakenType']), obj["ActionTakenAmount"], PlayerStateEnum.parse(obj['PlayerState']) )
def __str__(self): return '{0} ({1} {2}/{3} {4} {5}:{6} {7})'.format( super().__str__(), self.no_seat, self.total_played_money_amount, self.total_safe_money_amount, self.total_pot, GameActionEnum.to_string(self.action_taken_type), self.action_taken_amount, PlayerStateEnum.to_string(self.player_state) )
def decode(cls, obj): if obj == None: return None return cls( obj["NoSeat"], obj["Name"], obj["MoneySafeAmnt"], obj["MoneyBetAmnt"], obj["FaceUpCards"], obj["FaceDownCards"], PlayerStateEnum.parse(obj['State']) )
def _encode_specific(self, d): super()._encode_specific(d) d['NoSeat'] = self.no_seat d['FaceUpCards'] = self.face_up_cards d['FaceDownCards'] = self.face_down_cards d['PlayerState'] = PlayerStateEnum.to_string(self.player_state)