Files
PCK-Studio/PckStudio.Core/PackInfo.cs
2025-11-10 04:44:20 +01:00

28 lines
882 B
C#

using System;
using OMI.Formats.Pck;
namespace PckStudio.Core
{
public sealed class PackInfo
{
public static readonly PackInfo Empty = new PackInfo(default, default, default);
public bool IsValid { get; }
public PckFile File { get; }
public OMI.ByteOrder ByteOrder { get; }
public bool AllowByteOrderSwap { get; }
public static PackInfo Create(PckFile file, OMI.ByteOrder byteOrder, bool allowByteOrderSwap)
{
return new PackInfo(file, byteOrder, allowByteOrderSwap);
}
private PackInfo(PckFile file, OMI.ByteOrder byteOrder, bool allowByteOrderSwap)
{
File = file;
ByteOrder = byteOrder;
AllowByteOrderSwap = allowByteOrderSwap;
IsValid = file is not null && Enum.IsDefined(typeof(OMI.ByteOrder), byteOrder);
}
}
}