Пример #1
0
        public override void Save(BinaryWriter writer)
        {
            var sk = writer.BaseStream.Position;

            writer.Write(Header);
            for (var i = 0; i < arraySize; ++i)
            {
                writer.Write(agentLabAdditionsList[i].scriptCommandsAmount);
                if (agentLabAdditionsList[i].scriptCommandsAmount > 0)
                {
                    agentLabAdditionsList[i].scriptCommand.Write(writer);
                }
                writer.Write(scriptIds[i]);
            }
            scriptCommand.Write(writer);
        }
Пример #2
0
        public override void Save(BinaryWriter writer)
        {
            var sk = writer.BaseStream.Position;

            UpdateSlots();
            writer.Write(UnkBitfield);

            /*
             * for (int i = 0; i < 8; ++i)
             * {
             *  writer.Write(ScriptSlots[i]);
             * }
             */
            writer.Write((byte)OGIs.Count);
            //writer.Write(Anims.Count);
            writer.Write((byte)Scripts.Count);
            writer.Write((byte)Objects.Count);
            writer.Write((byte)UI32.Count);
            writer.Write(Sounds.Count);

            writer.Write(Name.Length);
            writer.Write(Name.ToCharArray());

            for (int i = 0; i < UI32.Count; ++i)
            {
                writer.Write(UI32[i]);
            }

            for (int i = 0; i < OGIs.Count; ++i)
            {
                writer.Write(OGIs[i]);
            }

            for (int i = 0; i < Anims.Count; ++i)
            {
                writer.Write(Anims[i]);
            }

            for (int i = 0; i < Scripts.Count; ++i)
            {
                writer.Write(Scripts[i]);
            }

            for (int i = 0; i < Objects.Count; ++i)
            {
                writer.Write(Objects[i]);
            }

            for (int i = 0; i < Sounds.Count; ++i)
            {
                writer.Write(Sounds[i]);
            }

            if ((UnkBitfield & 0x20000000) != 0x0)
            {
                //PHeader = (uint)((byte)instFlagsList.Count
                //| (instFloatsList.Count << 8)
                //| (instIntegerList.Count << 16));
                writer.Write((byte)instFlagsList.Count);
                writer.Write((byte)instFloatsList.Count);
                writer.Write((byte)instIntegerList.Count);
                writer.Write((byte)0);
                //writer.Write(PHeader);
                writer.Write(PUI32);
                for (int i = 0; i < instFlagsList.Count; ++i)
                {
                    writer.Write(instFlagsList[i]);
                }
                for (int i = 0; i < instFloatsList.Count; ++i)
                {
                    writer.Write(instFloatsList[i]);
                }
                for (int i = 0; i < instIntegerList.Count; ++i)
                {
                    writer.Write(instIntegerList[i]);
                }
            }

            if ((UnkBitfield & 0x40000000) != 0x0)
            {
                updateFlag();
                writer.Write(flag);
                if ((flag & 0x01) != 0)
                {
                    writer.Write(cObjects.Count);
                    for (int i = 0; i < cObjects.Count; ++i)
                    {
                        writer.Write(cObjects[i]);
                    }
                }
                if ((flag & 0x02) != 0)
                {
                    writer.Write(cOGIs.Count);
                    for (int i = 0; i < cOGIs.Count; ++i)
                    {
                        writer.Write(cOGIs[i]);
                    }
                }
                if ((flag & 0x04) != 0)
                {
                    writer.Write(cAnims.Count);
                    for (int i = 0; i < cAnims.Count; ++i)
                    {
                        writer.Write(cAnims[i]);
                    }
                }
                if ((flag & 0x08) != 0)
                {
                    writer.Write(cCM.Count);
                    for (int i = 0; i < cCM.Count; ++i)
                    {
                        writer.Write(cCM[i]);
                    }
                }
                if ((flag & 0x10) != 0)
                {
                    writer.Write(cScripts.Count);
                    for (int i = 0; i < cScripts.Count; ++i)
                    {
                        writer.Write(cScripts[i]);
                    }
                }
                if ((flag & 0x20) != 0)
                {
                    writer.Write(cUnk.Count);
                    for (int i = 0; i < cUnk.Count; ++i)
                    {
                        writer.Write(cUnk[i]);
                    }
                }
                if ((flag & 0x40) != 0)
                {
                    writer.Write(cSounds.Count);
                    for (int i = 0; i < cSounds.Count; ++i)
                    {
                        writer.Write(cSounds[i]);
                    }
                }
            }
            writer.Write(scriptCommandsAmount);
            if (scriptCommand != null)
            {
                scriptCommand.Write(writer);
            }
            size = (int)(writer.BaseStream.Position - sk);
        }