Example #1
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);
        }
Example #2
0
File: Zone.cs Project: a-kr/jsyoda
        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);
        }
Example #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));
            }
        }
Example #4
0
File: Zone.cs Project: a-kr/jsyoda
 public void Deserialize(YodaReader stream)
 {
     this.EntityId = stream.ReadShort();
     this.X = stream.ReadShort();
     this.Y = stream.ReadShort();
     this.Item = stream.ReadShort();
     this.NumItems = stream.ReadShort();
     this.Unk3 = stream.ReadShort();
     this.UnkTail = stream.ReadN(2 * 0x10);
 }
Example #5
0
File: Zone.cs Project: a-kr/jsyoda
 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;
     }
 }
Example #6
0
File: Zone.cs Project: a-kr/jsyoda
 public void Deserialize(YodaReader stream)
 {
     this.Item = stream.ReadShort();
 }
Example #7
0
        public void Deserialize(YodaReader stream)
        {
            this.Code = stream.ReadShort();
            this.Arg1 = stream.ReadShort();
            this.Arg2 = stream.ReadShort();
            this.Arg3 = stream.ReadShort();
            this.Arg4 = stream.ReadShort();
            this.Arg5 = stream.ReadShort();

            this.Str = stream.ReadLengthPrefixedString();
        }
Example #8
0
 public void Deserialize(YodaReader stream)
 {
     this.Code = stream.ReadShort();
     this.Arg1 = stream.ReadShort();
     this.Arg2 = stream.ReadShort();
     this.Arg3 = stream.ReadShort();
     this.Arg4 = stream.ReadShort();
     this.Arg5 = stream.ReadShort();
     this.Arg6 = stream.ReadShort();
 }