ElementController

blockudoku.controllers.mediatorImpl.ElementController

Manages game state related to Elements.

Attributes

See also
Graph
Supertypes
trait Observable
class Object
trait Matchable
class Any
Show all
Known subtypes

Members list

Type members

Classlikes

case class ElementControllerSnapshot(selectedElement: Option[Element], elements: List[Element])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Abstract methods

def regenerate(slot: Int): Element

Generates a new Element for the given slot.

Generates a new Element for the given slot.

Value parameters

slot

The slot to generate the Element for. Must be in the range of 0 to elementCount.

Attributes

Returns

The generated Element.

def selectElement(element: Element): Unit

Selects the given Element.

Selects the given Element.

Value parameters

element

Element to select.

Attributes

Concrete methods

def createSnapshot(): Unit

Creates a snapshot of the current state.

Creates a snapshot of the current state.

Attributes

override def getElements: List[Element]

Gets all selectable Element.

Gets all selectable Element.

Attributes

Returns

a list of Elements.

Definition Classes
override def getSelectedElement: Option[Element]

Gets the currently selected Element.

Gets the currently selected Element.

Attributes

Returns

an Element if any is selected, None otherwise.

Definition Classes
def loadElements(newElements: List[Element]): Unit
def resetSelectedElement(): Unit

Deselects the currently selected Element.

Deselects the currently selected Element.

Attributes

def revertSnapshot(): Unit

Reverts the state to the most recent snapshot.

Reverts the state to the most recent snapshot.

Attributes

Inherited methods

def addObserver(observer: Observer): Unit

Adds an observer to the list of observers.

Adds an observer to the list of observers.

Value parameters

observer

The observer to add.

Attributes

Inherited from:
Observable
def notifyObservers(): Unit

Invokes the update method of all observers.

Invokes the update method of all observers.

Attributes

Inherited from:
Observable

Abstract fields

val elementCount: Int

How many Elements are selectable at once.

How many Elements are selectable at once.

Attributes

var elements: List[Element]

The currently selectable Elements.

The currently selectable Elements.

Attributes

val maxElementLength: Int

The maximum length (in tiles) of an element.

The maximum length (in tiles) of an element.

Attributes

Concrete fields

var selectedElement: Option[Element]

The currently selected Element.

The currently selected Element.

Attributes

Inherited fields

Recorded snapshots with the most recent snapshot at the top.

Recorded snapshots with the most recent snapshot at the top.

Attributes

Inherited from:
Snapshotable