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
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"] )
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]) )