/// <summary>
        /// When overwritten, this function will write the prop
        /// </summary>
        /// <param name="s"></param>
        /// <param name="go"></param>
        /// <param name="f"></param>
        /// <param name="ms"></param>
        public virtual void WriteProp(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
        {
            //Write the header data
            ms.WriteArkClassname(name, s);
            ms.WriteArkClassname(type, s);
            ms.WriteInt(size);
            ms.WriteInt(index);

            //Now, the overwritten function will run.
        }
        public static DotArkGameObject ReadBaseFromFile(DotArkDeserializer ds)
        {
            //Read from the initial ArkGameObject table.
            DotArkGameObject go = new DotArkGameObject();
            var ms = ds.ms;

            go.guid      = new Guid(ms.ReadBytes(16));
            go.classname = ms.ReadArkClassname(ds);
            go.isItem    = ms.ReadIntBool();
            //Read the name array. Start by reading the integer length.
            int nameArrayLength = ms.ReadInt();

            go.names = new List <ArkClassName>();
            for (int i = 0; i < nameArrayLength; i++)
            {
                go.names.Add(ms.ReadArkClassname(ds));
            }
            //Read some unknown data
            go.unknownData1 = ms.ReadIntBool();
            go.unknownData2 = ms.ReadInt();
            //Read location data boolean
            bool locationDataExists = ms.ReadIntBool();

            if (locationDataExists)
            {
                go.locationData = ms.ReadLocationData(ds);
            }
            else
            {
                go.locationData = null;
            }
            //Read the offset to the property data
            go.propDataOffset = ms.ReadInt();
            //Read some last unknown data
            go.unknownData3 = ms.ReadInt();

            return(go);
        }
Beispiel #3
0
 public virtual void WriteStruct(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
 {
     throw new Exception("Unknown sturct type; Cannot write.");
 }