예제 #1
0
 def test_serialization(self):
     self.__sitdown_players()
     serial = self.seats.serialize()
     restored = Seats.deserialize(serial)
     for i in range(len(self.seats.players)):
         self.eq(Player.serialize(self.seats.players[i]),
                 Player.serialize(restored.players[i]))
예제 #2
0
 def deserialize(self, serial):
     deck = Deck.deserialize(serial[2])
     community_card = [Card.from_id(cid) for cid in serial[3]]
     table = self(cheat_deck=deck)
     table.dealer_btn = serial[0]
     table.seats = Seats.deserialize(serial[1])
     table._community_card = community_card
     table._blind_pos = serial[4]
     return table
예제 #3
0
 def test_serialization(self):
   self.__sitdown_players()
   serial = self.seats.serialize()
   restored = Seats.deserialize(serial)
   for i in range(len(self.seats.players)):
     self.eq(Player.serialize(self.seats.players[i]), Player.serialize(restored.players[i]))