예제 #1
0
 public static void Decode(Game_WebProtocol.FB_WebProtocol.Enemy destination, global::FB_WebProtocol.Enemy source)
 {
     destination.id     = source.Id;
     destination.name   = source.Name;
     destination.isLock = source.IsLock;
     destination.hp     = source.Hp;
     for (int i = 0; i < source.InventoryIdsLength; i++)
     {
         destination.inventoryIds.Add(source.InventoryIds(i));
     }
     if (source.DrivenCar.HasValue)
     {
         destination.drivenCar = FlatBuffersFacility.Pool.Get <FB_WebProtocol.Car>();
         Decode(destination.drivenCar, source.DrivenCar.Value);
     }
     for (int i = 0; i < source.OwnCarsLength; i++)
     {
         Car newCar = FlatBuffersFacility.Pool.Get <FB_WebProtocol.Car>();
         Decode(newCar, source.OwnCars(i).Value);
         destination.ownCars.Add(newCar);
     }
     for (int i = 0; i < source.AllNamesLength; i++)
     {
         destination.all_names.Add(source.AllNames(i));
     }
     if (source.Weapon.HasValue)
     {
         destination.weapon = FlatBuffersFacility.Pool.Get <FB_WebProtocol2.Weapon>();
         Decode(destination.weapon, source.Weapon.Value);
     }
     if (source.Weapon2.HasValue)
     {
         destination.weapon2 = FlatBuffersFacility.Pool.Get <FB_WebProtocol.Weapon>();
         Decode(destination.weapon2, source.Weapon2.Value);
     }
 }
예제 #2
0
 public void Decode(ByteBuffer bb)
 {
     global::FB_WebProtocol.Enemy source = global::FB_WebProtocol.Enemy.GetRootAsEnemy(bb);
     Game_WebProtocolConvertMethods.Decode(this, source);
 }