Ensure default values in models when not optional

This commit is contained in:
Matt Nadareski
2025-10-31 13:59:28 -04:00
parent 0dc8a0b6c0
commit b4e02d7f8c
362 changed files with 869 additions and 858 deletions

View File

@@ -121,7 +121,7 @@ namespace SabreTools.Data.Extensions
obj.Offset = data.ReadUInt32LittleEndian(ref offset);
obj.Timestamp = data.ReadUInt32LittleEndian(ref offset);
obj.Age = data.ReadUInt32LittleEndian(ref offset);
obj.PdbFileName = data.ReadNullTerminatedAnsiString(ref offset);
obj.PdbFileName = data.ReadNullTerminatedAnsiString(ref offset) ?? string.Empty;
return obj;
}
@@ -142,7 +142,7 @@ namespace SabreTools.Data.Extensions
obj.GUID = data.ReadGuid(ref offset);
obj.Age = data.ReadUInt32LittleEndian(ref offset);
obj.PathAndFileName = data.ReadNullTerminatedUTF8String(ref offset);
obj.PathAndFileName = data.ReadNullTerminatedUTF8String(ref offset) ?? string.Empty;
return obj;
}
@@ -260,7 +260,7 @@ namespace SabreTools.Data.Extensions
offset += sizeof(ushort);
// Read the menu resource as a string
dialogTemplateExtended.MenuResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset);
dialogTemplateExtended.MenuResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
// Align to the WORD boundary if we're not at the end
entry.Data.AlignToBoundary(ref offset, 2);
@@ -292,7 +292,7 @@ namespace SabreTools.Data.Extensions
offset += sizeof(ushort);
// Read the class resource as a string
dialogTemplateExtended.ClassResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset);
dialogTemplateExtended.ClassResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
// Align to the WORD boundary if we're not at the end
entry.Data.AlignToBoundary(ref offset, 2);
@@ -319,7 +319,7 @@ namespace SabreTools.Data.Extensions
else
{
// Read the title resource as a string
dialogTemplateExtended.TitleResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset);
dialogTemplateExtended.TitleResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
// Align to the WORD boundary if we're not at the end
entry.Data.AlignToBoundary(ref offset, 2);
@@ -340,7 +340,7 @@ namespace SabreTools.Data.Extensions
dialogTemplateExtended.Weight = entry.Data.ReadUInt16LittleEndian(ref offset);
dialogTemplateExtended.Italic = entry.Data.ReadByte(ref offset);
dialogTemplateExtended.CharSet = entry.Data.ReadByte(ref offset);
dialogTemplateExtended.Typeface = entry.Data.ReadNullTerminatedUnicodeString(ref offset);
dialogTemplateExtended.Typeface = entry.Data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
}
// Align to the DWORD boundary if we're not at the end
@@ -392,7 +392,7 @@ namespace SabreTools.Data.Extensions
offset += sizeof(ushort);
// Read the class resource as a string
dialogItemTemplate.ClassResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset);
dialogItemTemplate.ClassResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
// Align to the WORD boundary if we're not at the end
entry.Data.AlignToBoundary(ref offset, 2);
@@ -418,7 +418,7 @@ namespace SabreTools.Data.Extensions
else
{
// Read the title resource as a string
dialogItemTemplate.TitleResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset);
dialogItemTemplate.TitleResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
// Align to the WORD boundary if we're not at the end
entry.Data.AlignToBoundary(ref offset, 2);
@@ -482,7 +482,7 @@ namespace SabreTools.Data.Extensions
offset += sizeof(ushort);
// Read the menu resource as a string
dialogTemplate.MenuResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset);
dialogTemplate.MenuResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
// Align to the WORD boundary if we're not at the end
entry.Data.AlignToBoundary(ref offset, 2);
@@ -518,7 +518,7 @@ namespace SabreTools.Data.Extensions
offset += sizeof(ushort);
// Read the class resource as a string
dialogTemplate.ClassResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset);
dialogTemplate.ClassResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
// Align to the WORD boundary if we're not at the end
entry.Data.AlignToBoundary(ref offset, 2);
@@ -549,7 +549,7 @@ namespace SabreTools.Data.Extensions
else
{
// Read the title resource as a string
dialogTemplate.TitleResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset);
dialogTemplate.TitleResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
// Align to the WORD boundary if we're not at the end
entry.Data.AlignToBoundary(ref offset, 2);
@@ -569,7 +569,7 @@ namespace SabreTools.Data.Extensions
dialogTemplate.PointSizeValue = entry.Data.ReadUInt16LittleEndian(ref offset);
// Read the font name as a string
dialogTemplate.Typeface = entry.Data.ReadNullTerminatedUnicodeString(ref offset);
dialogTemplate.Typeface = entry.Data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
}
// Align to the DWORD boundary if we're not at the end
@@ -620,7 +620,7 @@ namespace SabreTools.Data.Extensions
offset += sizeof(ushort);
// Read the class resource as a string
dialogItemTemplate.ClassResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset);
dialogItemTemplate.ClassResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
// Align to the WORD boundary if we're not at the end
entry.Data.AlignToBoundary(ref offset, 2);
@@ -646,7 +646,7 @@ namespace SabreTools.Data.Extensions
else
{
// Read the title resource as a string
dialogItemTemplate.TitleResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset);
dialogItemTemplate.TitleResource = entry.Data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
// Align to the WORD boundary if we're not at the end
entry.Data.AlignToBoundary(ref offset, 2);
@@ -738,8 +738,8 @@ namespace SabreTools.Data.Extensions
dirEntry.Entry.Reserved = entry.Data.ReadUInt32LittleEndian(ref offset);
// TODO: Determine how to read these two? Immediately after?
dirEntry.Entry.DeviceName = entry.Data.ReadNullTerminatedAnsiString(ref offset);
dirEntry.Entry.FaceName = entry.Data.ReadNullTerminatedAnsiString(ref offset);
dirEntry.Entry.DeviceName = entry.Data.ReadNullTerminatedAnsiString(ref offset) ?? string.Empty;
dirEntry.Entry.FaceName = entry.Data.ReadNullTerminatedAnsiString(ref offset) ?? string.Empty;
fontGroupHeader.DE[i] = dirEntry;
}
@@ -927,7 +927,7 @@ namespace SabreTools.Data.Extensions
stringFileInfo.Length = data.ReadUInt16LittleEndian(ref offset);
stringFileInfo.ValueLength = data.ReadUInt16LittleEndian(ref offset);
stringFileInfo.ResourceType = (VersionResourceType)data.ReadUInt16LittleEndian(ref offset);
stringFileInfo.Key = data.ReadNullTerminatedUnicodeString(ref offset);
stringFileInfo.Key = data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
if (stringFileInfo.Key != "StringFileInfo")
{
offset -= 6 + ((stringFileInfo.Key?.Length ?? 0 + 1) * 2);
@@ -945,7 +945,7 @@ namespace SabreTools.Data.Extensions
stringTable.Length = data.ReadUInt16LittleEndian(ref offset);
stringTable.ValueLength = data.ReadUInt16LittleEndian(ref offset);
stringTable.ResourceType = (VersionResourceType)data.ReadUInt16LittleEndian(ref offset);
stringTable.Key = data.ReadNullTerminatedUnicodeString(ref offset);
stringTable.Key = data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
// Align to the DWORD boundary if we're not at the end
data.AlignToBoundary(ref offset, 4);
@@ -959,7 +959,7 @@ namespace SabreTools.Data.Extensions
stringData.Length = data.ReadUInt16LittleEndian(ref offset);
stringData.ValueLength = data.ReadUInt16LittleEndian(ref offset);
stringData.ResourceType = (VersionResourceType)data.ReadUInt16LittleEndian(ref offset);
stringData.Key = data.ReadNullTerminatedUnicodeString(ref offset);
stringData.Key = data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
// Align to the DWORD boundary if we're not at the end
data.AlignToBoundary(ref offset, 4);
@@ -1036,7 +1036,7 @@ namespace SabreTools.Data.Extensions
varFileInfo.Length = data.ReadUInt16LittleEndian(ref offset);
varFileInfo.ValueLength = data.ReadUInt16LittleEndian(ref offset);
varFileInfo.ResourceType = (VersionResourceType)data.ReadUInt16LittleEndian(ref offset);
varFileInfo.Key = data.ReadNullTerminatedUnicodeString(ref offset);
varFileInfo.Key = data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
if (varFileInfo.Key != "VarFileInfo")
return null;
@@ -1051,7 +1051,7 @@ namespace SabreTools.Data.Extensions
varData.Length = data.ReadUInt16LittleEndian(ref offset);
varData.ValueLength = data.ReadUInt16LittleEndian(ref offset);
varData.ResourceType = (VersionResourceType)data.ReadUInt16LittleEndian(ref offset);
varData.Key = data.ReadNullTerminatedUnicodeString(ref offset);
varData.Key = data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
if (varData.Key != "Translation")
{
offset -= 6 + ((varData.Key?.Length ?? 0 + 1) * 2);
@@ -1101,7 +1101,7 @@ namespace SabreTools.Data.Extensions
versionInfo.Length = entry.Data.ReadUInt16LittleEndian(ref offset);
versionInfo.ValueLength = entry.Data.ReadUInt16LittleEndian(ref offset);
versionInfo.ResourceType = (VersionResourceType)entry.Data.ReadUInt16LittleEndian(ref offset);
versionInfo.Key = entry.Data.ReadNullTerminatedUnicodeString(ref offset);
versionInfo.Key = entry.Data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
if (versionInfo.Key != "VS_VERSION_INFO")
return null;
@@ -1204,7 +1204,7 @@ namespace SabreTools.Data.Extensions
obj.State = (MenuFlags)data.ReadUInt32LittleEndian(ref offset);
obj.ID = data.ReadUInt32LittleEndian(ref offset);
obj.Flags = (MenuFlags)data.ReadUInt32LittleEndian(ref offset);
obj.MenuText = data.ReadNullTerminatedUnicodeString(ref offset);
obj.MenuText = data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
return obj;
}
@@ -1253,7 +1253,7 @@ namespace SabreTools.Data.Extensions
var obj = new NormalMenuItem();
obj.NormalResInfo = (MenuFlags)data.ReadUInt32LittleEndian(ref offset);
obj.NormalMenuText = data.ReadNullTerminatedUnicodeString(ref offset);
obj.NormalMenuText = data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
return obj;
}
@@ -1272,7 +1272,7 @@ namespace SabreTools.Data.Extensions
obj.PopupState = (MenuFlags)data.ReadUInt32LittleEndian(ref offset);
obj.PopupID = data.ReadUInt32LittleEndian(ref offset);
obj.PopupResInfo = (MenuFlags)data.ReadUInt32LittleEndian(ref offset);
obj.PopupMenuText = data.ReadNullTerminatedUnicodeString(ref offset);
obj.PopupMenuText = data.ReadNullTerminatedUnicodeString(ref offset) ?? string.Empty;
return obj;
}

View File

@@ -11,6 +11,6 @@ namespace SabreTools.Data.Models.AACS
/// Null-terminated ASCII string representing the copyright
/// </summary>
[MarshalAs(UnmanagedType.LPStr)]
public string Copyright;
public string Copyright = string.Empty;
}
}

View File

@@ -21,6 +21,6 @@ namespace SabreTools.Data.Models.AACS
/// <summary>
/// Revocation list entries
/// </summary>
public DriveRevocationSignatureBlock[] SignatureBlocks { get; set; }
public DriveRevocationSignatureBlock[] SignatureBlocks { get; set; } = [];
}
}

View File

@@ -12,6 +12,6 @@ namespace SabreTools.Data.Models.AACS
/// A list of 8-byte Host Drive List Entry fields, the length of this
/// list being equal to the number in the signature block.
/// </summary>
public DriveRevocationListEntry[] EntryFields { get; set; }
public DriveRevocationListEntry[] EntryFields { get; set; } = [];
}
}

View File

@@ -19,6 +19,6 @@ namespace SabreTools.Data.Models.AACS
/// must refuse to use the Media Key.
/// </summary>
/// <remarks><see cref="RecordLength"/>-4 bytes</remarks>
public byte[] SignatureData { get; set; }
public byte[] SignatureData { get; set; } = [];
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.AACS
/// <summary>
/// In this record, each subset-difference is encoded with 5 bytes.
/// </summary>
public SubsetDifference[] SubsetDifferences { get; set; }
public SubsetDifference[] SubsetDifferences { get; set; } = [];
}
}

View File

@@ -8,6 +8,6 @@ namespace SabreTools.Data.Models.AACS
/// <summary>
/// Unparsed data comprising the record after the header
/// </summary>
public byte[] Data { get; set; }
public byte[] Data { get; set; } = [];
}
}

View File

@@ -24,6 +24,6 @@ namespace SabreTools.Data.Models.AACS
/// <summary>
/// Revocation list entries
/// </summary>
public HostRevocationSignatureBlock[] SignatureBlocks { get; set; }
public HostRevocationSignatureBlock[] SignatureBlocks { get; set; } = [];
}
}

View File

@@ -12,6 +12,6 @@ namespace SabreTools.Data.Models.AACS
/// A list of 8-byte Host Revocation List Entry fields, the length of this
/// list being equal to the number in the signature block.
/// </summary>
public HostRevocationListEntry[] EntryFields { get; set; }
public HostRevocationListEntry[] EntryFields { get; set; } = [];
}
}

View File

@@ -9,6 +9,6 @@ namespace SabreTools.Data.Models.AACS
/// <summary>
/// Records
/// </summary>
public Record[] Records { get; set; }
public Record[] Records { get; set; } = [];
}
}

View File

@@ -13,6 +13,6 @@ namespace SabreTools.Data.Models.AACS
/// record. This 16 bytes is the ciphertext value C in the media
/// key calculation.
/// </summary>
public byte[][] MediaKeyData { get; set; }
public byte[][] MediaKeyData { get; set; } = [];
}
}

View File

@@ -21,6 +21,6 @@ namespace SabreTools.Data.Models.AACS
/// Subset-Difference record, with 0 being the start of the record.
/// </summary>
// <remarks>UInt24 not UInt32</remarks>
public uint[] Offsets { get; set; }
public uint[] Offsets { get; set; } = [];
}
}

View File

@@ -56,6 +56,6 @@ namespace SabreTools.Data.Models.AdvancedInstaller
/// <summary>
/// Unicode-encoded file name
/// </summary>
public string Name { get; set; }
public string Name { get; set; } = string.Empty;
}
}

View File

@@ -80,7 +80,7 @@ namespace SabreTools.Data.Models.AdvancedInstaller
/// Hex string that looks like a key or other identifier
/// </summary>
/// <remarks>32 bytes</remarks>
public string HexString { get; set; }
public string HexString { get; set; } = string.Empty;
/// <summary>
/// Unknown
@@ -99,7 +99,7 @@ namespace SabreTools.Data.Models.AdvancedInstaller
/// <summary>
/// "ADVINSTSFX"
/// </summary>
public string Signature { get; set; }
public string Signature { get; set; } = string.Empty;
/// <summary>
/// Unknown, always 0? Padding?

View File

@@ -19,11 +19,11 @@ namespace SabreTools.Data.Models.AdvancedInstaller
/// <summary>
/// Set of file entries
/// </summary>
public FileEntry[] Entries { get; set; }
public FileEntry[] Entries { get; set; } = [];
/// <summary>
/// Footer representing the central directory
/// </summary>
public Footer Footer { get; set; }
public Footer Footer { get; set; } = new();
}
}

View File

@@ -9,7 +9,7 @@ namespace SabreTools.Data.Models.BDPlus
/// "BDSVM_CC"
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
public string Signature;
public string Signature = string.Empty;
/// <summary>
/// Unknown data
@@ -45,6 +45,6 @@ namespace SabreTools.Data.Models.BDPlus
/// <summary>
/// <see cref="Length"> bytes of data
/// </summary>
public byte[] Data { get; set; }
public byte[] Data { get; set; } = [];
}
}

View File

@@ -9,11 +9,11 @@
/// <summary>
/// Header
/// </summary>
public Header Header { get; set; }
public Header Header { get; set; } = new();
/// <summary>
/// Files
/// </summary>
public FileEntry[] Files { get; set; }
public FileEntry[] Files { get; set; } = [];
}
}

View File

@@ -14,7 +14,7 @@
/// <summary>
/// Name
/// </summary>
public string Name { get; set; }
public string Name { get; set; } = string.Empty;
/// <summary>
/// Uncompressed size

View File

@@ -13,7 +13,7 @@ namespace SabreTools.Data.Models.BFPK
/// "BFPK"
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
public string Magic;
public string Magic = string.Empty;
/// <summary>
/// Version

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Indicies
/// </summary>
public LeafAmbientIndex[] Indicies { get; set; }
public LeafAmbientIndex[] Indicies { get; set; } = [];
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Lightings
/// </summary>
public LeafAmbientLighting[] Lightings { get; set; }
public LeafAmbientLighting[] Lightings { get; set; } = [];
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Brushes
/// </summary>
public Brush[] Brushes { get; set; }
public Brush[] Brushes { get; set; } = [];
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Brushsides
/// </summary>
public Brushside[] Brushsides { get; set; }
public Brushside[] Brushsides { get; set; } = [];
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Faces
/// </summary>
public BspFace[] Faces { get; set; }
public BspFace[] Faces { get; set; } = [];
}
}

View File

@@ -10,84 +10,84 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Header data
/// </summary>
public BspHeader Header { get; set; }
public BspHeader Header { get; set; } = new();
#region Lumps
/// <summary>
/// LUMP_ENTITIES [0]
/// </summary>
public EntitiesLump Entities { get; set; }
public EntitiesLump Entities { get; set; } = new();
/// <summary>
/// LUMP_PLANES [1]
/// </summary>
public PlanesLump PlanesLump { get; set; }
public PlanesLump PlanesLump { get; set; } = new();
/// <summary>
/// LUMP_TEXTURES [2]
/// </summary>
public TextureLump TextureLump { get; set; }
public TextureLump TextureLump { get; set; } = new();
/// <summary>
/// LUMP_VERTICES [3]
/// </summary>
public VerticesLump VerticesLump { get; set; }
public VerticesLump VerticesLump { get; set; } = new();
/// <summary>
/// LUMP_VISIBILITY [4]
/// </summary>
public VisibilityLump VisibilityLump { get; set; }
public VisibilityLump VisibilityLump { get; set; } = new();
/// <summary>
/// LUMP_NODES [5]
/// </summary>
public BspNodesLump NodesLump { get; set; }
public BspNodesLump NodesLump { get; set; } = new();
/// <summary>
/// LUMP_TEXINFO [6]
/// </summary>
public BspTexinfoLump TexinfoLump { get; set; }
public BspTexinfoLump TexinfoLump { get; set; } = new();
/// <summary>
/// LUMP_FACES [7]
/// </summary>
public BspFacesLump FacesLump { get; set; }
public BspFacesLump FacesLump { get; set; } = new();
/// <summary>
/// LUMP_LIGHTING [8]
/// </summary>
public LightmapLump LightmapLump { get; set; }
public LightmapLump LightmapLump { get; set; } = new();
/// <summary>
/// LUMP_CLIPNODES [9]
/// </summary>s
public ClipnodesLump ClipnodesLump { get; set; }
public ClipnodesLump ClipnodesLump { get; set; } = new();
/// <summary>
/// LUMP_LEAVES [10]
/// </summary>
public BspLeavesLump LeavesLump { get; set; }
public BspLeavesLump LeavesLump { get; set; } = new();
/// <summary>
/// LUMP_MARKSURFACES [11]
/// </summary>
public MarksurfacesLump MarksurfacesLump { get; set; }
public MarksurfacesLump MarksurfacesLump { get; set; } = new();
/// <summary>
/// LUMP_EDGES [12]
/// </summary>
public EdgesLump EdgesLump { get; set; }
public EdgesLump EdgesLump { get; set; } = new();
/// <summary>
/// LUMP_SURFEDGES [13]
/// </summary>
public SurfedgesLump SurfedgesLump { get; set; }
public SurfedgesLump SurfedgesLump { get; set; } = new();
/// <summary>
/// LUMP_MODELS [14]
/// </summary>
public BspModelsLump ModelsLump { get; set; }
public BspModelsLump ModelsLump { get; set; } = new();
#endregion
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Leaves
/// </summary>
public BspLeaf[] Leaves { get; set; }
public BspLeaf[] Leaves { get; set; } = [];
}
}

View File

@@ -27,17 +27,17 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Defines bounding box
/// </summary>
public Vector3D Mins;
public Vector3D Mins = new();
/// <summary>
/// Defines bounding box
/// </summary>
public Vector3D Maxs;
public Vector3D Maxs = new();
/// <summary>
/// Coordinates to move the coordinate system
/// </summary>
public Vector3D OriginVector;
public Vector3D OriginVector = new();
/// <summary>
/// Index into nodes array

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Model
/// </summary>
public BspModel[] Models { get; set; }
public BspModel[] Models { get; set; } = [];
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Nodes
/// </summary>
public BspNode[] Nodes { get; set; }
public BspNode[] Nodes { get; set; } = [];
}
}

View File

@@ -22,7 +22,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// S-vector
/// </summary>
public Vector3D SVector;
public Vector3D SVector = new();
/// <summary>
/// Texture shift in the S direction
@@ -32,7 +32,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// T-vector
/// </summary>
public Vector3D TVector;
public Vector3D TVector = new();
/// <summary>
/// Texture shift in the T direction

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Texinfos
/// </summary>
public BspTexinfo[] Texinfos { get; set; }
public BspTexinfo[] Texinfos { get; set; } = [];
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Clipnodes
/// </summary>
public Clipnode[] Clipnodes { get; set; }
public Clipnode[] Clipnodes { get; set; } = [];
}
}

View File

@@ -11,6 +11,6 @@ namespace SabreTools.Data.Models.BSP
public class CompressedLightCube
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public ColorRGBExp32[] Colors;
public ColorRGBExp32[] Colors = new ColorRGBExp32[6];
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Cubemaps
/// </summary>
public Cubemap[] Cubemaps { get; set; }
public Cubemap[] Cubemaps { get; set; } = [];
}
}

View File

@@ -25,7 +25,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Start position used for orientation
/// </summary>
public Vector3D StartPosition;
public Vector3D StartPosition = new();
/// <summary>
/// Index into LUMP_DISP_VERTS.

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Infos
/// </summary>
public DispInfo[] Infos { get; set; }
public DispInfo[] Infos { get; set; } = [];
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Tris
/// </summary>
public DispTri[] Tris { get; set; }
public DispTri[] Tris { get; set; } = [];
}
}

View File

@@ -18,7 +18,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Vector field defining displacement volume.
/// </summary>
public Vector3D Vec;
public Vector3D Vec = new();
/// <summary>
/// Displacement distances.

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Verts
/// </summary>
public DispVert[] Verts { get; set; }
public DispVert[] Verts { get; set; } = [];
}
}

View File

@@ -7,6 +7,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Edge
/// </summary>
public Edge[] Edges { get; set; }
public Edge[] Edges { get; set; } = [];
}
}

View File

@@ -7,6 +7,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Entities
/// </summary>
public Entity[] Entities { get; set; }
public Entity[] Entities { get; set; } = [];
}
}

View File

@@ -23,6 +23,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Entity attributes
/// </summary>
public List<KeyValuePair<string, string>> Attributes { get; set; }
public List<KeyValuePair<string, string>> Attributes { get; set; } = [];
}
}

View File

@@ -12,11 +12,11 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Number of game lumps
/// </summary>
public int LumpCount;
public int LumpCount { get; set; }
/// <summary>
/// <see cref="LumpCount"/>
/// </summary>
public GameLumpDirectory[] Directories;
public GameLumpDirectory[] Directories { get; set; } = [];
}
}

View File

@@ -16,7 +16,7 @@ namespace SabreTools.Data.Models.BSP
[StructLayout(LayoutKind.Sequential)]
public sealed class LeafAmbientLighting
{
public CompressedLightCube? Cube;
public CompressedLightCube Cube = new();
/// <summary>
/// Fixed point fraction of leaf bounds

View File

@@ -11,6 +11,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Map
/// </summary>
public ushort[] Map { get; set; }
public ushort[] Map { get; set; } = [];
}
}

View File

@@ -11,6 +11,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Map
/// </summary>
public ushort[] Map { get; set; }
public ushort[] Map { get; set; } = [];
}
}

View File

@@ -13,6 +13,6 @@ namespace SabreTools.Data.Models.BSP
/// Lightmap RGB values
/// </summary>
/// <remarks>Array of 3-byte values</remarks>
public byte[][] Lightmap { get; set; }
public byte[][] Lightmap { get; set; } = [];
}
}

View File

@@ -14,6 +14,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Marksurfaces
/// </summary>
public ushort[] Marksurfaces { get; set; }
public ushort[] Marksurfaces { get; set; } = [];
}
}

View File

@@ -23,7 +23,7 @@ namespace SabreTools.Data.Models.BSP
/// Name of texture
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Constants.MAXTEXTURENAME)]
public string? Name;
public string Name = string.Empty;
/// <summary>
/// Extends of the texture
@@ -39,6 +39,6 @@ namespace SabreTools.Data.Models.BSP
/// Offsets to texture mipmaps BSPMIPTEX
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.MIPLEVELS)]
public uint[] Offsets;
public uint[] Offsets = new uint[Constants.MIPLEVELS];
}
}

View File

@@ -27,12 +27,12 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Minima of all vertices
/// </summary>
public Vector3D Mins;
public Vector3D Mins = new();
/// <summary>
/// Maxima of all vertices
/// </summary>
public Vector3D Maxs;
public Vector3D Maxs = new();
/// <remarks>Since v1</remarks>
public int Area;

View File

@@ -27,20 +27,20 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// <see cref="Count">
/// </summary>
public OccluderData[] Data;
public OccluderData[] Data { get; set; } = [];
public int PolyDataCount;
/// <summary>
/// <see cref="PolyDataCount">
/// </summary>
public OccluderPolyData[] PolyData;
public OccluderPolyData[] PolyData { get; set; } = [];
public int VertexIndexCount;
/// <summary>
/// <see cref="VertexIndexCount">
/// </summary>
public int[] VertexIndicies;
public int[] VertexIndicies { get; set; } = [];
}
}

View File

@@ -41,8 +41,8 @@ namespace SabreTools.Data.Models.BSP
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public Vector3D[] UVPoints = new Vector3D[4];
public Vector3D Origin;
public Vector3D Origin = new();
public Vector3D BasisNormal;
public Vector3D BasisNormal = new();
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Overlays
/// </summary>
public Overlay[] Overlays { get; set; }
public Overlay[] Overlays { get; set; } = [];
}
}

View File

@@ -38,6 +38,6 @@ namespace SabreTools.Data.Models.BSP
/// Pakfile data
/// </summary>
/// TODO: Split and/or decompress data?
public byte[] Data;
public byte[] Data { get; set; } = [];
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Models
/// </summary>
public PhysModel[] Models { get; set; }
public PhysModel[] Models { get; set; } = [];
}
}

View File

@@ -32,11 +32,11 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Collision data of length <see cref="SolidCount"/>
/// </summary>
public PhysSolid[] Solids;
public PhysSolid[] Solids = [];
/// <summary>
/// Key data of size <see cref="KeydataSize"/>
/// </summary>
public byte[] TextData;
public byte[] TextData = [];
}
}

View File

@@ -20,6 +20,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Collision data of length <see cref="Size"/>
/// </summary>
public byte[] CollisionData;
public byte[] CollisionData = [];
}
}

View File

@@ -25,7 +25,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// The planes normal vector
/// </summary>
public Vector3D NormalVector;
public Vector3D NormalVector = new();
/// <summary>
/// Plane equation is: vNormal * X = fDist

View File

@@ -7,6 +7,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Planes
/// </summary>
public Plane[] Planes { get; set; }
public Plane[] Planes { get; set; } = [];
}
}

View File

@@ -19,6 +19,6 @@ namespace SabreTools.Data.Models.BSP
/// Model name
/// </summary>
/// <remarks>[dictEntries][128]</remarks>
public char[][] Name;
public char[][] Name = [];
}
}

View File

@@ -13,6 +13,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// <see cref="LeafEntries">
/// </summary>
public ushort[] Leaf;
public ushort[] Leaf = [];
}
}

View File

@@ -17,6 +17,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Surfedges
/// </summary>
public int[] Surfedges { get; set; }
public int[] Surfedges { get; set; } = [];
}
}

View File

@@ -16,7 +16,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// RGB reflectivity
/// </summary>
public Vector3D Reflectivity;
public Vector3D Reflectivity = new();
/// <summary>
/// Index into TexdataStringTable

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Texdatas
/// </summary>
public Texdata[] Texdatas { get; set; }
public Texdata[] Texdatas { get; set; } = [];
}
}

View File

@@ -10,6 +10,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Strings
/// </summary>
public string[] Strings { get; set; }
public string[] Strings { get; set; } = [];
}
}

View File

@@ -10,6 +10,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Offsets
/// </summary>
public int[] Offsets { get; set; }
public int[] Offsets { get; set; } = [];
}
}

View File

@@ -13,6 +13,6 @@ namespace SabreTools.Data.Models.BSP
/// Offsets
/// </summary>
/// <remarks><see cref="MipTextureCount"> entries</remarks>
public int[] Offsets { get; set; }
public int[] Offsets { get; set; } = [];
}
}

View File

@@ -6,11 +6,11 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Texture header data
/// </summary>
public TextureHeader Header { get; set; }
public TextureHeader Header { get; set; } = new();
/// <summary>
/// Textures
/// </summary>
public MipTexture[] Textures { get; set; }
public MipTexture[] Textures { get; set; } = [];
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Faces
/// </summary>
public VbspFace[] Faces { get; set; }
public VbspFace[] Faces { get; set; } = [];
}
}

View File

@@ -10,109 +10,109 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Header data
/// </summary>
public VbspHeader Header { get; set; }
public VbspHeader Header { get; set; } = new();
#region Lumps
/// <summary>
/// LUMP_ENTITIES [0]
/// </summary>
public EntitiesLump Entities { get; set; }
public EntitiesLump Entities { get; set; } = new();
/// <summary>
/// LUMP_PLANES [1]
/// </summary>
public PlanesLump PlanesLump { get; set; }
public PlanesLump PlanesLump { get; set; } = new();
/// <summary>
/// LUMP_TEXDATA [2]
/// </summary>
public TexdataLump TexdataLump { get; set; }
public TexdataLump TexdataLump { get; set; } = new();
/// <summary>
/// LUMP_VERTEXES [3]
/// </summary>
public VerticesLump VerticesLump { get; set; }
public VerticesLump VerticesLump { get; set; } = new();
/// <summary>
/// LUMP_VISIBILITY [4]
/// </summary>
public VisibilityLump VisibilityLump { get; set; }
public VisibilityLump VisibilityLump { get; set; } = new();
/// <summary>
/// LUMP_NODES [5]
/// </summary>
public VbspNodesLump NodesLump { get; set; }
public VbspNodesLump NodesLump { get; set; } = new();
/// <summary>
/// LUMP_TEXINFO [6]
/// </summary>
public VbspTexinfoLump TexinfoLump { get; set; }
public VbspTexinfoLump TexinfoLump { get; set; } = new();
/// <summary>
/// LUMP_FACES [7]
/// </summary>
public VbspFacesLump FacesLump { get; set; }
public VbspFacesLump FacesLump { get; set; } = new();
/// <summary>
/// LUMP_LIGHTING [8]
/// </summary>
public LightmapLump LightmapLump { get; set; }
public LightmapLump LightmapLump { get; set; } = new();
/// <summary>
/// LUMP_OCCLUSION [9]
/// </summary>s
public OcclusionLump OcclusionLump { get; set; }
public OcclusionLump OcclusionLump { get; set; } = new();
/// <summary>
/// LUMP_LEAVES [10]
/// </summary>
public VbspLeavesLump LeavesLump { get; set; }
public VbspLeavesLump LeavesLump { get; set; } = new();
/// <summary>
/// LUMP_FACEIDS [11]
/// </summary>
public MarksurfacesLump MarksurfacesLump { get; set; }
public MarksurfacesLump MarksurfacesLump { get; set; } = new();
/// <summary>
/// LUMP_EDGES [12]
/// </summary>
public EdgesLump EdgesLump { get; set; }
public EdgesLump EdgesLump { get; set; } = new();
/// <summary>
/// LUMP_SURFEDGES [13]
/// </summary>
public SurfedgesLump SurfedgesLump { get; set; }
public SurfedgesLump SurfedgesLump { get; set; } = new();
/// <summary>
/// LUMP_MODELS [14]
/// </summary>
public VbspModelsLump ModelsLump { get; set; }
public VbspModelsLump ModelsLump { get; set; } = new();
/// <summary>
/// LUMP_WORLDLIGHTS [15]
/// </summary>
public WorldLightsLump LDRWorldLightsLump { get; set; }
public WorldLightsLump LDRWorldLightsLump { get; set; } = new();
/// <summary>
/// LUMP_LEAFFACES [16]
/// </summary>
public LeafFacesLump LeafFacesLump { get; set; }
public LeafFacesLump LeafFacesLump { get; set; } = new();
/// <summary>
/// LUMP_LEAFBRUSHES [17]
/// </summary>
public LeafBrushesLump LeafBrushesLump { get; set; }
public LeafBrushesLump LeafBrushesLump { get; set; } = new();
/// <summary>
/// LUMP_BRUSHES [18]
/// </summary>
public BrushesLump BrushesLump { get; set; }
public BrushesLump BrushesLump { get; set; } = new();
/// <summary>
/// LUMP_BRUSHSIDES [19]
/// </summary>
public BrushsidesLump BrushsidesLump { get; set; }
public BrushsidesLump BrushsidesLump { get; set; } = new();
/// <summary>
/// LUMP_AREAS [20]
@@ -153,12 +153,12 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// LUMP_DISPINFO [26]
/// </summary>
public DispInfosLump DispInfosLump { get; set; }
public DispInfosLump DispInfosLump { get; set; } = new();
/// <summary>
/// LUMP_ORIGINALFACES [27]
/// </summary>
public VbspFacesLump OriginalFacesLump { get; set; }
public VbspFacesLump OriginalFacesLump { get; set; } = new();
/// <summary>
/// LUMP_PHYSDISP [28]
@@ -169,7 +169,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// LUMP_PHYSCOLLIDE [29]
/// </summary>
public PhysCollideLump PhysCollideLump { get; set; }
public PhysCollideLump PhysCollideLump { get; set; } = new();
/// <summary>
/// LUMP_VERTNORMALS [30]
@@ -192,7 +192,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// LUMP_DISP_VERTS [33]
/// </summary>
public DispVertsLump DispVertsLump { get; set; }
public DispVertsLump DispVertsLump { get; set; } = new();
/// <summary>
/// LUMP_DISP_LIGHTMAP_SAMPLE_POSITIONS [34]
@@ -203,7 +203,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// LUMP_GAME_LUMP [35]
/// </summary>
public GameLump GameLump { get; set; }
public GameLump GameLump { get; set; } = new();
/// <summary>
/// LUMP_LEAFWATERDATA [36]
@@ -232,7 +232,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// LUMP_PAKFILE [40]
/// </summary>
public PakfileLump PakfileLump { get; set; }
public PakfileLump PakfileLump { get; set; } = new();
/// <summary>
/// LUMP_CLIPPORTALVERTS [41]
@@ -243,22 +243,22 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// LUMP_CUBEMAPS [42]
/// </summary>
public CubemapsLump CubemapsLump { get; set; }
public CubemapsLump CubemapsLump { get; set; } = new();
/// <summary>
/// LUMP_TEXDATA_STRING_DATA [43]
/// </summary>
public TexdataStringData? TexdataStringData { get; set; }
public TexdataStringData TexdataStringData { get; set; } = new();
/// <summary>
/// LUMP_TEXDATA_STRING_TABLE [44]
/// </summary>
public TexdataStringTable? TexdataStringTable { get; set; }
public TexdataStringTable TexdataStringTable { get; set; } = new();
/// <summary>
/// LUMP_OVERLAYS [45]
/// </summary>
public OverlaysLump OverlaysLump { get; set; }
public OverlaysLump OverlaysLump { get; set; } = new();
/// <summary>
/// LUMP_LEAFMINDISTTOWATER [46]
@@ -275,7 +275,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// LUMP_DISP_TRIS [48]
/// </summary>
public DispTrisLump DispTrisLump { get; set; }
public DispTrisLump DispTrisLump { get; set; } = new();
/// <summary>
/// LUMP_PHYSCOLLIDESURFACE / LUMP_PROP_BLOB [49]
@@ -292,12 +292,12 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// LUMP_LIGHTMAPPAGES / LUMP_LEAF_AMBIENT_INDEX_HDR [51]
/// </summary>
public AmbientIndexLump HDRAmbientIndexLump { get; set; }
public AmbientIndexLump HDRAmbientIndexLump { get; set; } = new();
/// <summary>
/// LUMP_LIGHTMAPPAGEINFOS / LUMP_LEAF_AMBIENT_INDEX [52]
/// </summary>
public AmbientIndexLump LDRAmbientIndexLump { get; set; }
public AmbientIndexLump LDRAmbientIndexLump { get; set; } = new();
/// <summary>
/// LUMP_LIGHTING_HDR [53]
@@ -308,17 +308,17 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// LUMP_WORLDLIGHTS_HDR [54]
/// </summary>
public WorldLightsLump HDRWorldLightsLump { get; set; }
public WorldLightsLump HDRWorldLightsLump { get; set; } = new();
/// <summary>
/// LUMP_LEAF_AMBIENT_LIGHTING_HDR [55]
/// </summary>
public AmbientLightingLump HDRAmbientLightingLump { get; set; }
public AmbientLightingLump HDRAmbientLightingLump { get; set; } = new();
/// <summary>
/// LUMP_LEAF_AMBIENT_LIGHTING [56]
/// </summary>
public AmbientLightingLump LDRAmbientLightingLump { get; set; }
public AmbientLightingLump LDRAmbientLightingLump { get; set; } = new();
/// <summary>
/// LUMP_XZIPPAKFILE [57]

View File

@@ -11,7 +11,7 @@ namespace SabreTools.Data.Models.BSP
/// BSP file signature
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
public string Signature;
public string Signature = string.Empty;
/// <summary>
/// BSP file version

View File

@@ -83,7 +83,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Precaculated light info for entities.
/// </summary>
public CompressedLightCube AmbientLighting;
public CompressedLightCube AmbientLighting = new();
#endregion

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Leaves
/// </summary>
public VbspLeaf[] Leaves { get; set; }
public VbspLeaf[] Leaves { get; set; } = [];
}
}

View File

@@ -15,17 +15,17 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Bounding box
/// </summary>
public Vector3D Mins;
public Vector3D Mins = new();
/// <summary>
/// Bounding box
/// </summary>
public Vector3D Maxs;
public Vector3D Maxs = new();
/// <summary>
/// For sounds or lights
/// </summary>
public Vector3D OriginVector;
public Vector3D OriginVector = new();
/// <summary>
/// Index into nodes

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Model
/// </summary>
public VbspModel[] Models { get; set; }
public VbspModel[] Models { get; set; } = [];
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Nodes
/// </summary>
public VbspNode[] Nodes { get; set; }
public VbspNode[] Nodes { get; set; } = [];
}
}

View File

@@ -22,7 +22,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Texture S-vector
/// </summary>
public Vector3D TextureSVector;
public Vector3D TextureSVector = new();
/// <summary>
/// Texture shift in the S direction
@@ -32,7 +32,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Texture T-vector
/// </summary>
public Vector3D TextureTVector;
public Vector3D TextureTVector = new();
/// <summary>
/// Texture shift in the T direction
@@ -42,7 +42,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Lightmap S-vector
/// </summary>
public Vector3D LightmapSVector;
public Vector3D LightmapSVector = new();
/// <summary>
/// Lightmap shift in the S direction
@@ -52,7 +52,7 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Lightmap T-vector
/// </summary>
public Vector3D LightmapTVector;
public Vector3D LightmapTVector = new();
/// <summary>
/// Lightmap shift in the T direction

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Texinfos
/// </summary>
public VbspTexinfo[] Texinfos { get; set; }
public VbspTexinfo[] Texinfos { get; set; } = [];
}
}

View File

@@ -11,6 +11,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// Vertices
/// </summary>
public Vector3D[] Vertices { get; set; }
public Vector3D[] Vertices { get; set; } = [];
}
}

View File

@@ -17,6 +17,6 @@ namespace SabreTools.Data.Models.BSP
public int NumClusters { get; set; }
/// <remarks>[numclusters][2]</remarks>
public int[][] ByteOffsets { get; set; }
public int[][] ByteOffsets { get; set; } = [];
}
}

View File

@@ -14,14 +14,14 @@ namespace SabreTools.Data.Models.BSP
[StructLayout(LayoutKind.Sequential)]
public sealed class WorldLight
{
public Vector3D Origin;
public Vector3D Origin = new();
public Vector3D Intensity;
public Vector3D Intensity = new();
/// <summary>
/// For surfaces and spotlights
/// </summary>
public Vector3D Normal;
public Vector3D Normal = new();
public int Cluster;

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
/// <summary>
/// WorldLights
/// </summary>
public WorldLight[] WorldLights { get; set; }
public WorldLight[] WorldLights { get; set; } = [];
}
}

View File

@@ -6,13 +6,13 @@ namespace SabreTools.Data.Models.BZip2
/// <summary>
/// Stream header
/// </summary>
public Header Header { get; set; }
public Header Header { get; set; } = new();
// TODO: Implement remaining structures
/// <summary>
/// Stream footer
/// </summary>
public Footer Footer { get; set; }
public Footer Footer { get; set; } = new();
}
}

View File

@@ -5,7 +5,7 @@ namespace SabreTools.Data.Models.BZip2
/// <summary>
/// Block header
/// </summary>
public BlockHeader Header { get; set; }
public BlockHeader Header { get; set; } = new();
// TODO: Implement remaining structures
}

View File

@@ -5,7 +5,7 @@ namespace SabreTools.Data.Models.BZip2
/// <summary>
/// "BZ"
/// </summary>
public string Signature { get; set; }
public string Signature { get; set; } = string.Empty;
/// <summary>
/// Version byte

View File

@@ -12,7 +12,7 @@ namespace SabreTools.Data.Models.CFB
/// <summary>
/// Compound file header
/// </summary>
public FileHeader Header { get; set; }
public FileHeader Header { get; set; } = new();
/// <summary>
/// The FAT is the main allocator for space within a compound file.
@@ -25,7 +25,7 @@ namespace SabreTools.Data.Models.CFB
///
/// If Header Major Version is 4, there MUST be 1,024 fields specified to fill a 4,096-byte sector
/// </remarks>
public SectorNumber[] FATSectorNumbers { get; set; }
public SectorNumber[] FATSectorNumbers { get; set; } = [];
/// <summary>
/// The mini FAT is used to allocate space in the mini stream.
@@ -38,7 +38,7 @@ namespace SabreTools.Data.Models.CFB
///
/// If Header Major Version is 4, there MUST be 1,024 fields specified to fill a 4,096-byte sector
/// </remarks>
public SectorNumber[] MiniFATSectorNumbers { get; set; }
public SectorNumber[] MiniFATSectorNumbers { get; set; } = [];
/// <summary>
/// The DIFAT array is used to represent storage of the FAT sectors.
@@ -55,7 +55,7 @@ namespace SabreTools.Data.Models.CFB
/// If Header Major Version is 4, there MUST be 1,023 fields specified
/// to fill a 4,096-byte sector minus the "Next DIFAT Sector Location" field.
/// </remarks>
public SectorNumber[] DIFATSectorNumbers { get; set; }
public SectorNumber[] DIFATSectorNumbers { get; set; } = [];
/// <summary>
/// The directory entry array is an array of directory entries that
@@ -87,6 +87,6 @@ namespace SabreTools.Data.Models.CFB
/// all zeroes. The Modified Time field in the root storage directory
/// entry MAY be all zeroes.
/// <remarks>
public DirectoryEntry[] DirectoryEntries { get; set; }
public DirectoryEntry[] DirectoryEntries { get; set; } = [];
}
}

View File

@@ -20,7 +20,7 @@ namespace SabreTools.Data.Models.CFB
/// </summary>
/// <remarks>64 bytes</remarks>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string Name;
public string Name = string.Empty;
/// <summary>
/// This field MUST match the length of the Directory Entry Name Unicode

View File

@@ -75,7 +75,7 @@ namespace SabreTools.Data.Models.CFB
/// Properties
/// </summary>
/// <remarks>Each Variant might be followed by an index and offset value</remarks>
public Variant[] Properties { get; set; }
public Variant[] Properties { get; set; } = [];
#endregion
}

View File

@@ -40,6 +40,6 @@ namespace SabreTools.Data.Models.CFB
/// MUST contain an instance of the type, according to the value
/// in the <see cref="VariantType"/> field.
/// </summary>
public object Union { get; set; }
public object Union { get; set; } = new();
}
}

View File

@@ -10,7 +10,7 @@ namespace SabreTools.Data.Models.CHD
/// 'MComprHD'
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
public string Tag;
public string Tag = string.Empty;
/// <summary>
/// Length of header (including tag and length fields)

View File

@@ -10,7 +10,7 @@ namespace SabreTools.Data.Models.CHD
/// Which custom compressors are used?
/// </summary>
/// <remarks>There should be 4 entries</remarks>
public CodecType[] Compressors { get; set; }
public CodecType[] Compressors { get; set; } = [];
/// <summary>
/// Logical size of the data (in bytes)

View File

@@ -101,11 +101,11 @@
/// <summary>
/// COFF Relocations (Object Only)
/// </summary>
public Relocation[] COFFRelocations { get; set; }
public Relocation[] COFFRelocations { get; set; } = [];
/// <summary>
/// COFF Line Numbers (Deprecated)
/// </summary>
public LineNumber[] COFFLineNumbers { get; set; }
public LineNumber[] COFFLineNumbers { get; set; } = [];
}
}

View File

@@ -20,6 +20,6 @@
/// Following the size are null-terminated strings that are pointed to by symbols
/// in the COFF symbol table.
/// </summary>
public string[] Strings { get; set; }
public string[] Strings { get; set; } = [];
}
}

View File

@@ -11,7 +11,7 @@ namespace SabreTools.Data.Models.CueSheets
/// <summary>
/// filename
/// </summary>
public string? FileName { get; set; }
public string FileName { get; set; } = string.Empty;
/// <summary>
/// filetype
@@ -21,6 +21,6 @@ namespace SabreTools.Data.Models.CueSheets
/// <summary>
/// List of TRACK in FILE
/// </summary>
public CueTrack[] Tracks { get; set; }
public CueTrack[] Tracks { get; set; } = [];
}
}

View File

@@ -36,6 +36,6 @@ namespace SabreTools.Data.Models.CueSheets
/// <summary>
/// List of FILE in cuesheet
/// </summary>
public CueFile[] Files { get; set; }
public CueFile[] Files { get; set; } = [];
}
}

View File

@@ -53,7 +53,7 @@ namespace SabreTools.Data.Models.CueSheets
/// List of INDEX in TRACK
/// </summary>
/// <remarks>Must start with 0 or 1 and then sequential</remarks>
public CueIndex[] Indices { get; set; }
public CueIndex[] Indices { get; set; } = [];
/// <summary>
/// POSTGAP

View File

@@ -22,11 +22,11 @@ namespace SabreTools.Data.Models.DVD
/// Offset to VTS_ATRT n
/// </summary>
/// <remarks>NumberOfTitleSets entries</remarks>
public uint[] Offsets { get; set; }
public uint[] Offsets { get; set; } = [];
/// <summary>
/// Entries
/// </summary>
public AudioSubPictureAttributesTableEntry[] Entries { get; set; }
public AudioSubPictureAttributesTableEntry[] Entries { get; set; } = [];
}
}

View File

@@ -18,6 +18,6 @@ namespace SabreTools.Data.Models.DVD
/// Copy of VTS attributes (offset 100 and on from the VTS IFO
/// file, usually 0x300 bytes long)
/// </summary>
public byte[] AttributesCopy { get; set; }
public byte[] AttributesCopy { get; set; } = [];
}
}

View File

@@ -22,6 +22,6 @@ namespace SabreTools.Data.Models.DVD
/// 12-byte entries
/// </summary>
/// <remarks>NumberOfVOBIDs entries</remarks>
public CellAddressTableEntry[] Entries { get; set; }
public CellAddressTableEntry[] Entries { get; set; } = [];
}
}

View File

@@ -23,12 +23,12 @@ namespace SabreTools.Data.Models.DVD
/// Language Units
/// </summary>
/// <remarks>NumberOfVOBIDs entries</remarks>
public LanguageUnitTableEntry[] Entries { get; set; }
public LanguageUnitTableEntry[] Entries { get; set; } = [];
/// <summary>
/// Program Chains
/// </summary>
/// <remarks>NumberOfVOBIDs entries</remarks>
public ProgramChainTable[] ProgramChains { get; set; }
public ProgramChainTable[] ProgramChains { get; set; } = [];
}
}

Some files were not shown because too many files have changed in this diff Show More