Exemple #1
0
        public void Deserialize(YodaReader stream)
        {
            this.Magic = stream.ReadLong();
            this.Size = stream.ReadLong();
            this.Pad = stream.ReadShort();

            int n;
            n = stream.ReadShort();
            this.Entries1 = stream.ReadObjectArray<IzaxEntry1>(n);
            n = stream.ReadShort();
            this.Entries2 = stream.ReadObjectArray<IzaxEntry2>(n);
            n = stream.ReadShort();
            this.Entries3 = stream.ReadObjectArray<IzaxEntry3>(n);
        }
Exemple #2
0
        public void Deserialize(YodaReader stream)
        {
            int n;
            stream.ExpectAtCurrentPos("IACT");
            stream.ReadN(4);
            stream.ReadLong(); // length
            n = stream.ReadShort();
            this.Conditions = stream.ReadObjectArray<ScriptCondition>(n);

            n = stream.ReadShort();
            this.Actions = stream.ReadObjectArray<ScriptAction>(n);
        }
Exemple #3
0
        public void Deserialize(YodaReader stream)
        {
            this.Id = stream.ReadShort();
            stream.ExpectAtCurrentPos("IPUZ");
            stream.ReadLong(); // skip IPUZ
            this.ByteLength = stream.ReadLong();
            var endPosition = stream.S.Position + this.ByteLength;
            this.TailSize = 8;// GetTailSize(this.Id);

            var tailPosition = endPosition - this.TailSize;
            this.PuzzleType = stream.ReadUnsignedLong();
            this.Head2_u32 = stream.ReadUnsignedLong();
            this.Head3_u32 = stream.ReadUnsignedLong();
            this.Head4_u16 = stream.ReadShort();
            var strings = new List<string>();
            while (stream.S.Position < tailPosition)
            {
                strings.Add(stream.ReadLengthPrefixedString().Replace("\r", "\\r").Replace("\n", "\\n").Replace(";", ","));
            }
            this.Strings = strings.ToArray();

            this.Tail1_u16 = stream.ReadShort();
            this.Tail2_u16 = stream.ReadShort();
            this.RewardItem = stream.ReadShort();
            if (this.TailSize > 6)
            {
                this.Tail3_u16 = stream.ReadShort();
            }

            if (stream.S.Position != endPosition)
            {
                this.SizeError = (int)(stream.S.Position - endPosition);
                stream.S.Seek(endPosition, System.IO.SeekOrigin.Begin);
                //throw new Exception(string.Format("Expected to end at {0}, actual position is {1}", endPosition, stream.S.Position));
            }
        }
Exemple #4
0
 private void ReadObjectInfo(YodaReader s)
 {
     var n = s.ReadShort();
     this.ObjectInfos = new ZoneObjectInfo[n];
     for (var i = 0; i < n; i++)
     {
         var obj = new ZoneObjectInfo();
         obj.Type = s.ReadLong();
         obj.X = s.ReadShort();
         obj.Y = s.ReadShort();
         obj.Unk1 = s.ReadShort();
         obj.Arg = s.ReadShort();
         this.ObjectInfos[i] = obj;
     }
 }
Exemple #5
0
        public void Deserialize(YodaReader stream)
        {
            var puzzles = new List<Ipuz>();

            stream.Seek(0x457048, System.IO.SeekOrigin.Begin);

            stream.ExpectAtCurrentPos("PUZ2");
            stream.ReadLong(); // PUZ2
            stream.ReadLong(); // skip length
            while (stream.CurrentPosContainsAtOffset("IPUZ", 2))
            {
                var ipuz = new Ipuz();
                ipuz.Deserialize(stream);
                puzzles.Add(ipuz);
            }

            this.Puzzles = puzzles.ToArray();
        }