checkpoint
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Foodsoft.Alpm
|
||||
{
|
||||
public class Depend
|
||||
public class Depend : IEquatable<Depend>
|
||||
{
|
||||
public enum ModType
|
||||
{
|
||||
@@ -15,13 +16,20 @@ namespace Foodsoft.Alpm
|
||||
GreaterThan,
|
||||
LessThan
|
||||
}
|
||||
|
||||
|
||||
public string Name { get; }
|
||||
public string Version { get; }
|
||||
public string Description { get; }
|
||||
public ulong NameHash { get; }
|
||||
public ModType Mod { get; }
|
||||
|
||||
public override bool Equals(object? obj) => (obj is Depend other) && this.Equals(other);
|
||||
|
||||
public bool Equals(Depend? other) => !ReferenceEquals(other, null) && ReferenceEquals(this, other) &&
|
||||
Name == other.Name && Version == other.Version && Mod == other.Mod;
|
||||
|
||||
public override int GetHashCode() => HashCode.Combine(Name, Version, (int) Mod);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private readonly unsafe struct NativeDepend
|
||||
{
|
||||
@@ -41,6 +49,5 @@ namespace Foodsoft.Alpm
|
||||
NameHash = native->name_hash;
|
||||
Mod = native->mod;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user