mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2024-06-01 00:41:36 +00:00
24 lines
567 B
Scala
24 lines
567 B
Scala
package com.htmlism.mos6502.dsl
|
|
package snake
|
|
|
|
import cats.data.NonEmptyList
|
|
|
|
object Direction:
|
|
given directionBitField: BitField[Direction] =
|
|
new BitField[Direction]:
|
|
def definitionGroupComment: String =
|
|
"Directions"
|
|
|
|
def all: NonEmptyList[Direction] =
|
|
NonEmptyList.of(Up, Down, Left, Right)
|
|
|
|
def label(x: Direction): String =
|
|
"moving" + x.toString
|
|
|
|
sealed trait Direction
|
|
|
|
case object Up extends Direction
|
|
case object Down extends Direction
|
|
case object Left extends Direction
|
|
case object Right extends Direction
|