Initial Commit. Including framework for Downloads, Java, and Mods.
This commit is contained in:
43
AlayaCore/Models/Manifests/InstalledModEntry.cs
Normal file
43
AlayaCore/Models/Manifests/InstalledModEntry.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user