public PowerSet Read() { var powerset = new PowerSet(); powerset.DisplayName = _reader.ReadString(); powerset.Archetype = _reader.ReadInt32(); powerset.SetType = _reader.ReadInt32(); powerset.ImageName = _reader.ReadString(); powerset.FullName = _reader.ReadString(); if (string.IsNullOrEmpty(powerset.FullName)) { powerset.FullName = "Orphan." + powerset.DisplayName.Replace(" ", "_"); } powerset.SetName = _reader.ReadString(); powerset.Description = _reader.ReadString(); powerset.SubName = _reader.ReadString(); powerset.ClassType = _reader.ReadString(); powerset.TrunkSet = _reader.ReadString(); powerset.LinkSecondary = _reader.ReadString(); int mutuallyExclusiveSetCount = _reader.ReadInt32(); powerset.MutuallyExclusiveGroups = new MutuallyExclusiveGroup[mutuallyExclusiveSetCount + 1]; for (int index = 0; index < powerset.MutuallyExclusiveGroups.Length; ++index) { powerset.MutuallyExclusiveGroups[index] = new MutuallyExclusiveGroup { Name = _reader.ReadString(), Id = _reader.ReadInt32() }; } return(powerset); }
public void Write(PowerSet powerSet) { _writer.Write(powerSet.DisplayName); _writer.Write(powerSet.Archetype); _writer.Write(powerSet.SetType); _writer.Write(powerSet.ImageName); _writer.Write(powerSet.FullName); _writer.Write(powerSet.SetName); _writer.Write(powerSet.Description); _writer.Write(powerSet.SubName); _writer.Write(powerSet.ClassType); _writer.Write(powerSet.TrunkSet); _writer.Write(powerSet.LinkSecondary); _writer.Write(powerSet.MutuallyExclusiveGroups.Length - 1); foreach (var group in powerSet.MutuallyExclusiveGroups) { _writer.Write(group.Name); _writer.Write(group.Id); } }