forked from Shardstone/trail-into-darkness
45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace Jovian.PopupSystem {
|
|
[Serializable]
|
|
public struct PopupCategory : IEquatable<PopupCategory> {
|
|
[SerializeField] string id;
|
|
|
|
public string Id => id;
|
|
|
|
public PopupCategory(string id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public static readonly PopupCategory Character = new("Character");
|
|
public static readonly PopupCategory Item = new("Item");
|
|
public static readonly PopupCategory Skill = new("Skill");
|
|
public static readonly PopupCategory General = new("General");
|
|
|
|
public bool Equals(PopupCategory other) {
|
|
return string.Equals(id, other.id, StringComparison.Ordinal);
|
|
}
|
|
|
|
public override bool Equals(object obj) {
|
|
return obj is PopupCategory other && Equals(other);
|
|
}
|
|
|
|
public override int GetHashCode() {
|
|
return id != null ? id.GetHashCode() : 0;
|
|
}
|
|
|
|
public override string ToString() {
|
|
return id ?? string.Empty;
|
|
}
|
|
|
|
public static bool operator ==(PopupCategory left, PopupCategory right) {
|
|
return left.Equals(right);
|
|
}
|
|
|
|
public static bool operator !=(PopupCategory left, PopupCategory right) {
|
|
return !left.Equals(right);
|
|
}
|
|
}
|
|
}
|