using System;

namespace KitsuneCafe.UI
{
    public readonly struct DespawnElementRequest : IEquatable<DespawnElementRequest>
    {
        public readonly ElementId Id;

        public DespawnElementRequest(ElementId id)
        {
            Id = id;
        }

        public static DespawnElementRequest Create(ElementId id) => new(id);

        public override bool Equals(object obj)
        {
            return obj is DespawnElementRequest req
                && Equals(req);
        }

        public bool Equals(DespawnElementRequest other)
        {
            return other.Id == Id;
        }

        public override int GetHashCode()
        {
            return HashCode.Combine(Id);
        }

        public override string ToString()
        {
            return $"DespawnElementRequest {{ Id = {Id} }}";
        }
    }
}