Example #1
0
        public uint GetSize()
        {
            uint size = 0;

            size += sizeof(ushort);
            for (int i = 0; i < items.Count; ++i)
            {
                DB_Character item = items[i];
                size += item.GetSize();
            }
            return(size);
        }
Example #2
0
 public bool Encode(BinaryEncoder encoder)
 {
     {
         ushort _size = (ushort)items.Count;
         if (!BinaryCodec.Encode(encoder, _size))
         {
             return(false);
         }
         for (int i = 0; i < items.Count; ++i)
         {
             DB_Character item = items[i];
             if (!item.Encode(encoder))
             {
                 return(false);
             }
         }
     }
     return(true);
 }
Example #3
0
 public DB_Character(DB_Character rho)
 {
     ID            = rho.ID;
     Name          = rho.Name;
     CharacterType = rho.CharacterType;
     displayName   = rho.displayName;
     spriteName    = rho.spriteName;
     default_str   = rho.default_str;
     default_dex   = rho.default_dex;
     default_con   = rho.default_con;
     default_int   = rho.default_int;
     default_spr   = rho.default_spr;
     default_wis   = rho.default_wis;
     default_hp    = rho.default_hp;
     default_mp    = rho.default_mp;
     rewordXP      = rho.rewordXP;
     rewordGold    = rho.rewordGold;
     isDrop        = rho.isDrop;
     dropList      = rho.dropList;
 }
Example #4
0
 public bool Decode(BinaryDecoder decoder)
 {
     {
         ushort _size = 0;
         if (!BinaryCodec.Decode(decoder, out _size))
         {
             return(false);
         }
         items.Capacity = _size;
         for (int i = 0; i < _size; ++i)
         {
             DB_Character item = new DB_Character();
             if (!item.Decode(decoder))
             {
                 return(false);
             }
             items.Add(item);
         }
     }
     return(true);
 }