public RSLT(int APIversion, EventHandler handler, RSLT basis) : base(APIversion, handler, null) { this.version = basis.version; this.routes = new PartList(handler, basis.routes); this.routeOffsets = basis.routeOffsets == null ? null : new SlotOffsetList(handler, basis.routeOffsets); this.containers = basis.containers == null ? null : new SlottedPartList(handler, basis.containers); this.containerOffsets = basis.containerOffsets == null ? null : new SlotOffsetList(handler, basis.containerOffsets); this.effects = basis.effects == null ? null : new PartList(handler, basis.effects); this.effectOffsets = basis.effectOffsets == null ? null : new SlotOffsetList(handler, basis.effectOffsets); this.inverseKineticsTargets = basis.inverseKineticsTargets == null ? null : new PartList(handler, basis.inverseKineticsTargets); this.inverseKineticsTargetOffsets = basis.inverseKineticsTargetOffsets == null ? null : new SlotOffsetList(handler, basis.inverseKineticsTargetOffsets); }
protected override void Parse(Stream s) { BinaryReader r = new BinaryReader(s); tag = r.ReadUInt32(); if (checking) { if (tag != (uint)FOURCC(TAG)) { throw new InvalidDataException(String.Format("Invalid Tag read: '{0}'; expected: '{1}'; at 0x{2:X8}", FOURCC(tag), TAG, s.Position)); } } version = r.ReadUInt32(); int nRouteSlots = r.ReadInt32(); int nContainers = r.ReadInt32(); int nEffects = r.ReadInt32(); int nInverseKineticsTargets = r.ReadInt32(); int nConeSlots = r.ReadInt32(); if (checking) { if (nConeSlots != 0) { throw new InvalidDataException(string.Format("Expected zero, read 0x{0:X8} at 0x{1:X8}", nConeSlots, s.Position)); } } routes = new PartList(handler, s, nRouteSlots); if (nRouteSlots == 0) { routeOffsets = new SlotOffsetList(handler); } else { routeOffsets = new SlotOffsetList(handler, s); } containers = new SlottedPartList(handler, s, nContainers); if (nContainers == 0) { containerOffsets = new SlotOffsetList(handler); } else { containerOffsets = new SlotOffsetList(handler, s); } effects = new PartList(handler, s, nEffects); if (nEffects == 0) { effectOffsets = new SlotOffsetList(handler); } else { effectOffsets = new SlotOffsetList(handler, s); } inverseKineticsTargets = new PartList(handler, s, nInverseKineticsTargets); if (nInverseKineticsTargets == 0) { inverseKineticsTargetOffsets = new SlotOffsetList(handler); } else { inverseKineticsTargetOffsets = new SlotOffsetList(handler, s); } cones = new ConePartList(handler, s, nConeSlots); if (nConeSlots == 0) { coneOffsets = new SlotOffsetList(handler); } else { coneOffsets = new SlotOffsetList(handler, s); } }