public void WriteBinary(ArkArchive archive)
        {
            archive.WriteFloat(X);
            archive.WriteFloat(Y);
            archive.WriteFloat(Z);
            archive.WriteByte(UnkByte);
            archive.WriteFloat(UnkFloat);

            archive.WriteInt(nameTableSize);
            ArkArchive nameArchive = archive.Slice(nameTableSize);

            nameArchive.WriteInt(3);

            nameArchive.WriteInt(nameTable.Count);
            nameTable.ForEach(nameArchive.WriteString);

            nameArchive.WriteInt(ZoneVolumes.Count);
            ZoneVolumes.ForEach(nameArchive.WriteName);

            archive.WriteInt(objectsSize);
            ArkArchive objectArchive = archive.Slice(objectsSize);

            objectArchive.WriteInt(Objects.Count);

            int currentOffset = propertiesStart;

            foreach (GameObject gameObject in Objects)
            {
                currentOffset = gameObject.WriteBinary(objectArchive, currentOffset);
            }

            objectArchive.SetNameTable(nameTable, 0, true);
            foreach (GameObject gameObject in Objects)
            {
                gameObject.WriteProperties(objectArchive, 0);
            }

            archive.WriteInt(UnkInt1);
            archive.WriteInt(ClassIndex);
        }
Пример #2
0
        private void writeBinaryHeader(ArkArchive archive)
        {
            archive.WriteShort(SaveVersion);

            if (SaveVersion > 6)
            {
                archive.WriteInt(hibernationOffset);
                archive.WriteInt(0);
            }

            if (SaveVersion > 5)
            {
                archive.WriteInt(nameTableOffset);
                archive.WriteInt(propertiesBlockOffset);
            }

            archive.WriteFloat(GameTime);

            if (SaveVersion > 8)
            {
                archive.WriteInt(SaveCount);
            }
        }