Example #1
0
        public override void Open()
        {
            Close();

            BinaryReader br    = IOStream.GetBinaryReader();
            InfEntry     entry = new InfEntry();

            byte[] buff = new byte[10];
            IOStream.EnsureRead(buff, 0, 10);

            entry.Name      = Encoding.ASCII.GetString(buff, 0, 9).TrimEnd('\0');
            entry.Direction = buff[9];

            entry.Unknown = br.ReadUInt32();
            if (IOStream.Length == 676)
            {
                entry.PvP = br.ReadUInt32();
            }

            entry.HeightCameraFocus = br.ReadUInt16();
            if (IOStream.Length == 504)
            {
                entry.CameraRanges = IOStream.ReadStructs <RectInt16>(1);
            }
            else
            {
                entry.CameraRanges = IOStream.ReadStructs <RectInt16>(8);
                entry.ScreenRanges = IOStream.ReadStructs <RectInt16>(2);
            }

            entry.Gateways = IOStream.Length < 672 ? ReadSmallGateways() : IOStream.ReadStructs <InfGateway>(12);
            entry.Triggers = IOStream.ReadStructs <InfTrigger>(12);

            if (!IOStream.IsEndOfStream())
            {
                throw new Exception();
            }

            Entry = entry;
        }
Example #2
0
 public override void Close()
 {
     IOStream.Seek(0, SeekOrigin.Begin);
     Entry = null;
 }