This repository has been archived on 2022-08-05. You can view files and clone it, but cannot push or open issues or pull requests.
WebHax/WebHax/UTApp.cs

40 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using static System.Environment;
namespace WebHax
{
public struct UTApp : IEquatable<UTApp>
{
public readonly string Name;
public readonly string Description;
public readonly Version Version;
public readonly string File;
public readonly string Hash;
public readonly Guid Id;
public readonly int Index;
public UTApp(string name, string description, Version version, string file, string hash, Guid iD, int index)
{
Name = name ?? throw new ArgumentNullException(nameof(name));
Description = description ?? throw new ArgumentNullException(nameof(description));
Version = version;
File = file ?? throw new ArgumentNullException(nameof(file));
Hash = hash ?? throw new ArgumentNullException(nameof(hash));
Id = iD;
Index = index;
}
public override bool Equals(object obj) => obj is UTApp app && Equals(app);
public bool Equals(UTApp other) => Id.Equals(other.Id);
public override int GetHashCode() => 1213502048 + EqualityComparer<Guid>.Default.GetHashCode(Id);
public static bool operator ==(UTApp left, UTApp right) => left.Equals(right);
public static bool operator !=(UTApp left, UTApp right) => !(left == right);
}
}