namespace Engine.Graphics.Pipeline;

public class RenderLayer : IComparable<RenderLayer>
{
  public static readonly RenderLayer DEFAULT = new("default", 0);
  public static readonly RenderLayer OVERLAY = new("overlay", 1);
  public static readonly RenderLayer HUD = new("hud", 2);

  public static readonly IReadOnlyList<RenderLayer> ALL = new List<RenderLayer> { DEFAULT, OVERLAY, HUD }.AsReadOnly();

  public string Name { get; }
  private readonly int _order;

  private RenderLayer(string parName, int parOrder)
  {
    Name = parName;
    _order = parOrder;
  }

  public override string ToString()
  {
    return Name;
  }

  public int CompareTo(RenderLayer? parOther)
  {
    return _order.CompareTo(parOther?._order);
  }

  public override int GetHashCode()
  {
    return Name.GetHashCode();
  }
}