Reactor

final case
class Reactor[A](initial: A, onMouseClickHandler: (Point, A) => A, onMouseMoveHandler: (Point, A) => A, onTickHandler: A => A, tickRate: FiniteDuration, renderHandler: A => Image, stopHandler: A => Boolean) extends BaseReactor[A]

A Reactor that has reasonable defaults and a simple builder style for creating more complicated behaviour.

Companion
object
trait Serializable
trait Product
trait Equals
trait BaseReactor[A]
class Object
trait Matchable
class Any

Value members

Concrete methods

def draw[Alg <: ([x[_]] =>> Basic[x]), F[_], Frame, Canvas](frame: Frame)(implicit renderer: Renderer[Alg, F, Frame, Canvas], runtime: IORuntime): Unit
def draw[Alg <: ([x[_]] =>> Basic[x]), F[_], Frame, Canvas]()(implicit renderer: DefaultRenderer[Alg, F, Frame, Canvas], runtime: IORuntime): Unit
def onMouseClick(location: Point, state: A): A
def onMouseMove(location: Point, state: A): A
def onTick(state: A): A
def render(value: A): Image
def step: Reactor[A]
def stop(value: A): Boolean
def withOnMouseClick(f: (Point, A) => A): Reactor[A]
def withOnMouseMove(f: (Point, A) => A): Reactor[A]
def withOnTick(f: A => A): Reactor[A]
def withRender(f: A => Image): Reactor[A]
def withStop(f: A => Boolean): Reactor[A]
def withTickRate(duration: FiniteDuration): Reactor[A]

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product
def run[Alg <: ([x[_]] =>> Basic[x]), F[_], Frame, Canvas](frame: Frame)(implicit a: AnimationRenderer[Canvas], e: Renderer[Alg, F, Frame, Canvas], m: MouseClick[Canvas] & MouseMove[Canvas], runtime: IORuntime): Unit

Runs this reactor, drawing on the given frame, until stop indicates it should stop.

Runs this reactor, drawing on the given frame, until stop indicates it should stop.

Inherited from
BaseReactor
def tick[F[_], Frame, Canvas](frame: Frame)(implicit e: Renderer[[F[_]] =>> Basic[F], F, Frame, Canvas], runtime: IORuntime): Option[A]

Run one tick of this reactor, drawing on the given frame. Returns the next state, or None if the Reactor has stopped.

Run one tick of this reactor, drawing on the given frame. Returns the next state, or None if the Reactor has stopped.

Inherited from
BaseReactor