Esempio n. 1
0
 @Override
 public Message WriteBuffer() {
   CardsProtos.AI.Builder builder = CardsProtos.AI.newBuilder();
   for (Card c : mSelectedCards) {
     builder.addSelectedCards((CardsProtos.Card) c.WriteBuffer());
   }
   builder.setId(getIdentity().get().getId());
   return builder.build();
 }
Esempio n. 2
0
 @Override
 public void ReadBuffer(Message msg) {
   CardsProtos.AI ai = (CardsProtos.AI) msg;
   mSelectedCards.clear();
   for (CardsProtos.Card protoCard : ai.getSelectedCardsList()) {
     mSelectedCards.add(Card.GetCard(protoCard));
   }
   mIdentity = new Identity(ai.getId());
 }