Packages

case class Rules(gameField: GameField) extends Product with Serializable

Connects the Chess Rules to a GameField

gameField

GameField to which the Rules are applied

Linear Supertypes
Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Rules
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Rules(gameField: GameField)

    gameField

    GameField to which the Rules are applied

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. val gameField: GameField
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  10. def moveValidFigure(xNow: Int, yNow: Int, xNext: Int, yNext: Int): Boolean

    Calls specific Rules for the Figure in question

    Calls specific Rules for the Figure in question

    xNow

    x-Axis Position on the GameField

    yNow

    y-Axis Position on the GameField

    xNext

    x-Axis Position of the destination

    yNext

    y-Axis Position of the destination

    returns

    true if move valid, otherwise false

  11. def moveValidWithoutKingCheck(xNow: Int, yNow: Int, xNext: Int, yNext: Int): Boolean

    Determines wether the specific Move results in Check.

    Determines wether the specific Move results in Check.

    In contradiciton to the methode name it inspects the move being valid to any position. But if the goal is to determine wether a King could possibly be checked the method is called like this:

    validPawnWithoutKingCheck(figure, King.xPos, King.yPos)
    xNow

    x-Axis Position on the GameField

    yNow

    y-Axis Position on the GameField

    xNext

    x-Axis Position of the destination

    yNext

    y-Axis Position of the destination

    returns

    true if King isn't checked, otherwise false

  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. def productElementNames: Iterator[String]
    Definition Classes
    Product
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. def validBishop(figure: Bishop, xNext: Int, yNext: Int): Boolean

    See validBishopWithoutKingCheck

  18. def validBishopWithoutKingCheck(figure: Bishop, xNext: Int, yNext: Int): Boolean

    Verifies if a Bishop is moving valid.

    Verifies if a Bishop is moving valid.

    A Bishop can move any number of cells diagonal (as long as there is no allied Piece in the way or an enemy Piece is hit).

    See also moveValidWithoutKingCheck

    figure

    The to be moved Bishop

    xNext

    x-Axis Position of the destination

    yNext

    y-Axis Position of the destination

    returns

    true if move valid, otherwise false

  19. def validKing(figure: King, xNext: Int, yNext: Int): Boolean

    See validKingWithoutKingCheck

  20. def validKingWithoutKingCheck(figure: King, xNext: Int, yNext: Int): Boolean

    Verifies if a King is moving valid.

    Verifies if a King is moving valid.

    A King can move 1 cell diagonal or straight (as long as there is no allied Piece in the way or an enemy Piece is hit).

    See also moveValidWithoutKingCheck

    figure

    The to be moved King

    xNext

    x-Axis Position of the destination

    yNext

    y-Axis Position of the destination

    returns

    true if move valid, otherwise false

  21. def validKnight(figure: Knight, xNext: Int, yNext: Int): Boolean

    See validKnightWithoutKingCheck

  22. def validKnightWithoutKingCheck(figure: Knight, xNext: Int, yNext: Int): Boolean

    Verifies if a Knight is moving valid.

    Verifies if a Knight is moving valid.

    A Knight can move two cells horizontally then one cell vertically or two cells vertically then one horizontally.

    It is not blocked by other Pieces, the Knight jumps to the new location.

    See also moveValidWithoutKingCheck

    figure

    The to be moved Knight

    xNext

    x-Axis Position of the destination

    yNext

    y-Axis Position of the destination

    returns

    true if move valid, otherwise false

  23. def validPawn(figure: Pawn, xNext: Int, yNext: Int): Boolean

    See validPawnWithoutKingCheck

  24. def validPawnWithoutKingCheck(figure: Pawn, xNext: Int, yNext: Int): Boolean

    Verifies if a Pawn is moving valid.

    Verifies if a Pawn is moving valid.

    A Pawn can move 2 cells upward if it hasn't been moved yet, or 1 cell if it has.

    It can only move 1 cell in the diagonal if there is an enemy Piece.

    Pawns can never move backward.

    See also moveValidWithoutKingCheck

    figure

    The to be moved Pawn

    xNext

    x-Axis Position of the destination

    yNext

    y-Axis Position of the destination

    returns

    true if move valid, otherwise false

  25. def validQueen(figure: Queen, xNext: Int, yNext: Int): Boolean

    See validQueenWithoutKingCheck

  26. def validQueenWithoutKingCheck(figure: Queen, xNext: Int, yNext: Int): Boolean

    Verifies if a Queen is moving valid.

    Verifies if a Queen is moving valid.

    A Queen can move any number of cells diagonal or straight (as long as there is no allied Piece in the way or an enemy Piece is hit).

    See also moveValidWithoutKingCheck

    figure

    The to be moved Queen

    xNext

    x-Axis Position of the destination

    yNext

    y-Axis Position of the destination

    returns

    true if move valid, otherwise false

  27. def validRook(figure: Rook, xNext: Int, yNext: Int): Boolean

    See validRookWithoutKingCheck

  28. def validRookWithoutKingCheck(figure: Rook, xNext: Int, yNext: Int): Boolean

    Verifies if a Rook is moving valid.

    Verifies if a Rook is moving valid.

    A Rook can move any number of cells straight (as long as there is no allied Piece in the way or an enemy Piece is hit). See also moveValidWithoutKingCheck

    figure

    The to be moved Rook

    xNext

    x-Axis Position of the destination

    yNext

    y-Axis Position of the destination

    returns

    true if move valid, otherwise false

  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped