Skip to content

Instantly share code, notes, and snippets.

@TheBizzle
Created November 18, 2014 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save TheBizzle/1f112d5b9e1b34e41960 to your computer and use it in GitHub Desktop.
Save TheBizzle/1f112d5b9e1b34e41960 to your computer and use it in GitHub Desktop.
abstract class InputBoxType[T](val name:String)
case object Num extends InputBoxType[Double]("Number")
case object Str extends InputBoxType[String]("String")
case object StrReporter extends InputBoxType[String]("String (reporter)")
case object StrCommand extends InputBoxType[String]("String (commands)")
case object Col extends InputBoxType[Int]("Color")
case class InputBox[T](left: Int = 0, top: Int = 0, right: Int = 0, bottom: Int = 0, varName: String, value: T, multiline: Boolean = false, boxtype: InputBoxType[T])
val ib = InputBox(0, 0, 0, 0, "apples", 9001, false, Col)
ib.boxtype match { case Col => "hello" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment