def decode(cls, obj): type = LobbyTypeEnum.parse(obj['OptionType']) if type == LobbyTypeEnum.QuickMode: return LobbyOptionsQuickMode.decode(obj) if type == LobbyTypeEnum.RegisteredMode: return LobbyOptionsRegisteredMode.decode(obj) return None
def __str__(self): return '{0} => {1} ({2}) ({3})'.format( super().__str__(), self.implemented_protocol_version, ', '.join([LobbyTypeEnum.to_string(x) for x in self.supported_lobby_types]), ', '.join([x.__str__() for x in self.available_games]) )
def decode(cls, obj): return cls( obj['Success'], BluffinMessageIdEnum.parse(obj['MessageId']), obj['Message'], obj['Command'], obj['ImplementedProtocolVersion'], [LobbyTypeEnum.parse(x) for x in obj['SupportedLobbyTypes']], [GameInfo.decode(x) for x in obj['AvailableGames']] )
def _encode_specific(self, d): super()._encode_specific(d) d['ImplementedProtocolVersion'] = self.implemented_protocol_version d['SupportedLobbyTypes'] = [LobbyTypeEnum.to_string(x) for x in self.supported_lobby_types] d['AvailableGames'] = [x.encode() for x in self.available_games]
def __str__(self): return '{0} ({1})'.format( super().__str__(), ', '.join([LobbyTypeEnum.to_string(x) for x in self.lobby_types]) )
def decode(cls, obj): return cls( [LobbyTypeEnum.parse(x) for x in obj['LobbyTypes']] )
def _encode_specific(self, d): super()._encode_specific(d) d['LobbyTypes'] = [LobbyTypeEnum.to_string(x) for x in self.lobby_types]
def encode(self): d = OrderedDict() d['OptionType'] = LobbyTypeEnum.to_string(self.option_type) self._encode_specific(d) self._encode_specific_end(d) return d
def __str__(self): return LobbyTypeEnum.to_string(self.option_type)