Skip to content

Commit

Permalink
Merge pull request #29 from InX-Invader/patch-1
Browse files Browse the repository at this point in the history
Update DataMapping member types.
  • Loading branch information
peter-dolkens authored Mar 17, 2021
2 parents 19da048 + 1bdd1d5 commit 1a8a062
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/unforge/ComplexTypes/DataForgeDataMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@ namespace unforge
{
public class DataForgeDataMapping : _DataForgeSerializable
{
public UInt16 StructIndex { get; set; }
public UInt16 StructCount { get; set; }
public UInt32 StructIndex { get; set; }
public UInt32 StructCount { get; set; }
public UInt32 NameOffset { get; set; }
public String Name { get { return this.DocumentRoot.ValueMap[this.NameOffset]; } }

public DataForgeDataMapping(DataForge documentRoot)
: base(documentRoot)
{
this.StructCount = this._br.ReadUInt16();
this.StructIndex = this._br.ReadUInt16();
if(this.DocumentRoot.FileVersion >= 5) {
this.StructCount = this._br.ReadUInt32();
this.StructIndex = this._br.ReadUInt32();
} else {
this.StructCount = this._br.ReadUInt16();
this.StructIndex = this._br.ReadUInt16();
}
this.NameOffset = documentRoot.StructDefinitionTable[this.StructIndex].NameOffset;
}

Expand Down

0 comments on commit 1a8a062

Please sign in to comment.