forked from heliosphere-xiv/path-mapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWeaponType.cs
More file actions
23 lines (13 loc) · 814 Bytes
/
WeaponType.cs
File metadata and controls
23 lines (13 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
namespace PathMapper;
public readonly struct WeaponType : IEquatable<WeaponType> {
public readonly ushort Value;
public WeaponType(ushort value) => this.Value = value;
public static implicit operator WeaponType(ushort id) => new(id);
public static explicit operator ushort(WeaponType id) => id.Value;
public override string ToString() => this.Value.ToString();
public bool Equals(WeaponType other) => this.Value == other.Value;
public override bool Equals(object? obj) => obj is WeaponType other && this.Equals(other);
public override int GetHashCode() => this.Value.GetHashCode();
public static bool operator ==(WeaponType lhs, WeaponType rhs) => lhs.Value == rhs.Value;
public static bool operator !=(WeaponType lhs, WeaponType rhs) => lhs.Value != rhs.Value;
}