def decode(cls, obj):
     type = GameTypeEnum.parse(obj['OptionType'])
     if type == GameTypeEnum.CommunityCardsPoker:
         return GameTypeOptionsCommunity.decode(obj)
     if type == GameTypeEnum.DrawPoker:
         return GameTypeOptionsDraw.decode(obj)
     if type == GameTypeEnum.StudPoker:
         return GameTypeOptionsStud.decode(obj)
     return None
Beispiel #2
0
 def decode(cls, obj):
     return cls(
         GameTypeEnum.parse(obj['GameType']),
         [GameSubTypeEnum.parse(x) for x in obj['AvailableVariants']],
         [LimitTypeEnum.parse(x) for x in obj['AvailableLimits']],
         [BlindTypeEnum.parse(x) for x in obj['AvailableBlinds']],
         obj["MinPlayers"],
         obj["MaxPlayers"]
     )
Beispiel #3
0
 def encode(self):
     d = OrderedDict()
     d['GameType'] = GameTypeEnum.to_string(self.game_type)
     d['AvailableVariants'] = [GameSubTypeEnum.to_string(x) for x in self.available_variants]
     d['AvailableLimits'] = [LimitTypeEnum.to_string(x) for x in self.available_limits]
     d['AvailableBlinds'] = [BlindTypeEnum.to_string(x) for x in self.available_blinds]
     d['MinPlayers'] = self.min_players
     d['MaxPlayers'] = self.max_players
     return d
Beispiel #4
0
 def __str__(self):
     return '{0}, [{1}], {2}/{3}, ({4}), ({5})'.format(
         GameTypeEnum.to_string(self.game_type),
         ', '.join([GameSubTypeEnum.to_string(x) for x in self.available_variants]),
         self.min_players,
         self.max_players,
         ', '.join([LimitTypeEnum.to_string(x) for x in self.available_limits]),
         ', '.join([BlindTypeEnum.to_string(x) for x in self.available_blinds])
     )
 def __str__(self):
     return GameTypeEnum.to_string(self.option_type)
 def encode(self):
     d = OrderedDict()
     d['OptionType'] = GameTypeEnum.to_string(self.option_type)
     self._encode_specific(d)
     self._encode_specific_end(d)
     return d