Esempio n. 1
0
 @Override
 public void deserialize(Buffer buf) {
   houseId = buf.readInt();
   if (houseId < 0)
     throw new RuntimeException(
         "Forbidden value on houseId = "
             + houseId
             + ", it doesn't respect the following condition : houseId < 0");
 }
Esempio n. 2
0
 @Override
 public void deserialize(Buffer buf) {
   objectUID = buf.readInt();
   if (objectUID < 0)
     throw new RuntimeException(
         "Forbidden value on objectUID = "
             + objectUID
             + ", it doesn't respect the following condition : objectUID < 0");
   foodUID = buf.readInt();
   if (foodUID < 0)
     throw new RuntimeException(
         "Forbidden value on foodUID = "
             + foodUID
             + ", it doesn't respect the following condition : foodUID < 0");
   foodQuantity = buf.readShort();
   if (foodQuantity < 0)
     throw new RuntimeException(
         "Forbidden value on foodQuantity = "
             + foodQuantity
             + ", it doesn't respect the following condition : foodQuantity < 0");
 }
Esempio n. 3
0
 @Override
 public void deserialize(Buffer buf) {
   short flag1 = buf.readUByte();
   isOnSale = BooleanByteWrapper.getFlag(flag1, 0);
   isSaleLocked = BooleanByteWrapper.getFlag(flag1, 1);
   houseId = buf.readInt();
   if (houseId < 0)
     throw new RuntimeException(
         "Forbidden value on houseId = "
             + houseId
             + ", it doesn't respect the following condition : houseId < 0");
   int limit = buf.readUShort();
   doorsOnMap = new int[limit];
   for (int i = 0; i < limit; i++) {
     doorsOnMap[i] = buf.readInt();
   }
   ownerName = buf.readString();
   modelId = buf.readShort();
   if (modelId < 0)
     throw new RuntimeException(
         "Forbidden value on modelId = "
             + modelId
             + ", it doesn't respect the following condition : modelId < 0");
 }