Beispiel #1
0
        /// <summary>
        /// Deserializes the ID's and creates them in the <see cref="Drive"/>.
        /// </summary>
        /// <param name="reader"></param>
        public override void Deserialize(NetworkReader reader)
        {
            byte[][] ByteArray = new byte[4][];
            ByteArray[0] = reader.ReadBytesAndSize();
            ByteArray[1] = reader.ReadBytesAndSize();
            ByteArray[2] = reader.ReadBytesAndSize();
            ByteArray[3] = reader.ReadBytesAndSize();
            int[] IDs = NetworkHelper.DeserializeIntArray(ByteArray);

            byte[] Equippeds = reader.ReadBytesAndSize();

            Drive.Clear();
            for (int i = 0; i < IDs.Length; i++)
            {
                int ID = IDs[i];
                if (ID >= 0)
                {
                    Drive.AddItemToIndex(ItemDB.Singleton.Get(ID), i);
                    Drive.GetSlots()[i].Equipped = (Equippeds[i] == 1 ? true : false);
                }
            }
        }