package ocelot.desktop.node

import totoro.ocelot.brain.util.Tier.Tier

class NodeType(val name: String, val icon: String, val tier: Option[Tier], factory: => Node) extends Ordered[NodeType] {
  def make(): Node = factory

  override def compare(that: NodeType): Int = this.name.compare(that.name)
}

object NodeType {
  def apply(name: String, icon: String, tier: Tier)(factory: => Node): NodeType =
    new NodeType(name, icon, Some(tier), factory)

  def apply(name: String, icon: String, tier: Option[Tier])(factory: => Node): NodeType =
    new NodeType(name, icon, tier, factory)
}
