Ejemplo n.º 1
0
 /// <summary>
 /// Constructs a new Table and reads the header.
 /// </summary>
 /// <param name="reader">
 /// The SaveReader to read from. It should be positioned at the start of the table header.
 /// When the function finishes, it will point to the first entry in the entry list (see the HeaderSize constant).
 /// </param>
 public Table(SaveReader reader)
 {
     _name = reader.ReadAscii(0x1E);
     reader.Skip(2);
     _entryCount = reader.ReadUInt32();
     _entrySize  = reader.ReadUInt32();
     reader.Skip(0x28);
     _tableSizeWHeader    = reader.ReadUInt32();
     _tmpTableStartOffset = reader.Position;
 }
Ejemplo n.º 2
0
 public ObjectEntry(DatumIndex index, SaveReader reader)
 {
     _index    = index;
     _flags    = reader.ReadByte();
     _tagGroup = (TagGroup)reader.ReadByte();
     reader.Skip(4);
     _chunkOffset = reader.ReadUInt32();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructs a new ObjectEntry, reading it from a SaveReader.
 /// </summary>
 /// <param name="index">The object's datum index.</param>
 /// <param name="reader">The SaveReader to read from. It should point to the section of the table entry after the salt.</param>
 public ObjectEntry(DatumIndex index, SaveReader reader)
 {
     _index    = index;
     _flags    = reader.ReadByte();
     _tagGroup = (TagGroup)reader.ReadByte();
     reader.Skip(2); // Unknown value
     _chunkSize    = reader.ReadUInt16();
     _chunkAddress = reader.ReadUInt32();
 }
Ejemplo n.º 4
0
        protected override void ReadFrom(SaveReader reader, long baseOffset)
        {
            base.ReadFrom(reader, baseOffset);

            reader.SeekTo(baseOffset + AmmoOffset);
            _remainingAmmo = reader.ReadInt16();
            reader.Skip(2);
            _clipAmmo = reader.ReadInt16();
        }