BaseReactor

doodle.reactor.BaseReactor
See theBaseReactor companion object
trait BaseReactor[A]

A reactor is a simple way to express an interactive program. It allows us to write programs in terms of some initial state and transformations of that state in response to inputs and clock ticks.

This is the basic interface. See Reactor for a more user friendly implementation.

It is based on the same abstraction in Pyret.

Attributes

Companion:
object
Source:
BaseReactor.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Reactor[A]

Members list

Concise view

Value members

Abstract methods

def initial: A

Attributes

Source:
BaseReactor.scala
def onMouseClick(location: Point, state: A): A

Attributes

Source:
BaseReactor.scala
def onMouseMove(location: Point, state: A): A

Attributes

Source:
BaseReactor.scala
def onTick(state: A): A

Attributes

Source:
BaseReactor.scala
def render(value: A): Image

Attributes

Source:
BaseReactor.scala
def stop(value: A): Boolean

Attributes

Source:
BaseReactor.scala

Concrete methods

def run[Alg <: Basic, Frame, Canvas](frame: Frame)(implicit a: AnimationRenderer[Canvas], e: Renderer[Alg, 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.

Attributes

Source:
BaseReactor.scala
def tick[Frame, Canvas](frame: Frame)(implicit e: Renderer[Basic, 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.

Attributes

Source:
BaseReactor.scala