예제 #1
0
 def encode(self):
     d = OrderedDict()
     d['IdTable'] = self.id_table
     d['NbPlayers'] = self.nb_players
     d['PossibleAction'] = LobbyActionEnum.to_string(self.possible_action)
     d['Params'] = self.params.encode()
     return d
예제 #2
0
 def decode(cls, obj):
     return cls(
         obj["IdTable"],
         obj["NbPlayers"],
         LobbyActionEnum.parse(obj['PossibleAction']),
         TableParams.decode(obj['Params'])
     )
예제 #3
0
 def __str__(self):
     return '{0}({1}) {2} [{3}]'.format(
         self.id_table,
         self.nb_players,
         LobbyActionEnum.to_string(self.possible_action),
         self.params
     )