Files
AlayaCore/AlayaCore/Models/Manifests/InstalledModEntry.cs

43 lines
1.3 KiB
C#

using System;
namespace AlayaCore.Models.Manifests
{
[Serializable]
public sealed class InstalledModEntry
{
public string FileName { get; }
public string Version { get; }
public string Sha512Hash { get; }
public long Size { get; set; }
public InstalledModEntry(string fileName, string version, string sha512Hash, long size)
{
if (string.IsNullOrWhiteSpace(fileName))
{
throw new ArgumentException("Name cannot be null, empty, or whitespace.", nameof(fileName));
}
if (string.IsNullOrWhiteSpace(version))
{
throw new ArgumentException("Version cannot be null, empty, or whitespace.", nameof(version));
}
if (string.IsNullOrWhiteSpace(sha512Hash))
{
throw new ArgumentException("SHA512Hash cannot be null, empty, or whitespace.", nameof(sha512Hash));
}
if (size == 0)
{
throw new ArgumentException("Size cannot be 0, empty, or whitespace.", nameof(size));
}
FileName = fileName;
Version = version;
Sha512Hash = sha512Hash;
Size = size;
}
}
}