Packages

class GameField extends GameFieldInterface

The GameField of our Chess Game, realized as a Vector of Figures

Linear Supertypes
GameFieldInterface, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GameField
  2. GameFieldInterface
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new GameField()
  2. new GameField(gameField: Vector[Figure])

    gameField

    - The Vector which is keeping track of all the moves etc.

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. val CHECKED: Int
    Definition Classes
    GameFieldInterface
  5. val CHECKMATE: Int
    Definition Classes
    GameFieldInterface
  6. val MOVE_ILLEGAL: Int
    Definition Classes
    GameFieldInterface
  7. val PAWN_REACHED_END: Int
    Definition Classes
    GameFieldInterface
  8. val RUNNING: Int
    Definition Classes
    GameFieldInterface
  9. def addFigures(figures: Vector[Figure]): GameField

    Adds the Figures to the gameField if the gameField does not contain them yet

    Adds the Figures to the gameField if the gameField does not contain them yet

    figures

    - Vector of Figures to adjust the current gameField

    returns

    new gameField

    Definition Classes
    GameFieldGameFieldInterface
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def cellsFreeAroundFigure(figure: Figure): List[(Int, Int)]

    Checks the adjacent cells and returns a list of those who are free

    Checks the adjacent cells and returns a list of those who are free

    figure

    which adjacent cells should be reviewed

    returns

    List of free cells

    Definition Classes
    GameFieldGameFieldInterface
  12. def changePlayer(): Color

    Changes the valid Player's color

    Changes the valid Player's color

    e.g. If it was White's turn before it is now Black's turn

    White -> Black Black -> White

    returns

    The color of the new valid Player

    Definition Classes
    GameFieldGameFieldInterface
  13. def clear(): Boolean

    Sets the valid Player to White.

    Sets the valid Player to White. Clears the gameField.

    returns

    true if the gameField is now empty

    Definition Classes
    GameFieldGameFieldInterface
  14. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  15. def convertFigure(figure: Figure, toFigure: Figure): Unit

    Converts one Figure to another

    Converts one Figure to another

    (Mostly used for converting a Pawn into Queen, Rook, Bishop or Knight after reaching the end)

    figure

    to convert

    toFigure

    of the wanted type

    Definition Classes
    GameFieldGameFieldInterface
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  18. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. def getFigure(xPos: Int, yPos: Int): Option[Figure]

    Fetches the Figure at the specified position.

    Fetches the Figure at the specified position.

    With

    getFigure(x, y).get

    you are able to fetch the actual Figure. But an Exception will be thrown if the cell is empty and the call returns Option[None]! getFigure(x, y).get }}} But an Exception will be thrown if the cell is empty and the call returns Option[None]!

    xPos

    value of the field

    yPos

    value of the field

    returns

    Option[Figure] if there is a Figure, Option[None] if the cell is empty

    Definition Classes
    GameFieldGameFieldInterface
  20. def getFigures: Vector[Figure]

    returns

    All Figures from the gameField, also those who are checked

    Definition Classes
    GameFieldGameFieldInterface
  21. def getPawnAtEnd(): Pawn

    returns

    the Pawn at the end

    Definition Classes
    GameFieldGameFieldInterface
  22. def getPlayer: Color

    returns

    Color of the Player who has to make his turn now (the valid Player)

    Definition Classes
    GameFieldGameFieldInterface
  23. def getStatus(): Int

    returns

    the gameField/ Game status

    Definition Classes
    GameFieldGameFieldInterface
  24. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  25. def isChecked(playerCol: Color): Boolean

    Inspects if the Player is checked by confirming wether any of the other Player's Figures could move to the King

    Inspects if the Player is checked by confirming wether any of the other Player's Figures could move to the King

    playerCol

    color of the to be examined Player

    returns

    true if checked, else false

    Definition Classes
    GameFieldGameFieldInterface
  26. def isCheckmate(playerCol: Color): Boolean

    Reviews wether there is no possibility for the king to get out of check by verifying if any cells around him are free that he can move to, to get out of check

    Reviews wether there is no possibility for the king to get out of check by verifying if any cells around him are free that he can move to, to get out of check

    playerCol

    color of the Player to examine

    returns

    true if the king can't move anymore, else false

    Definition Classes
    GameFieldGameFieldInterface
  27. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  28. def moveTo(xNow: Int, yNow: Int, xNext: Int, yNext: Int): GameField

    Moves Figure from (xNow, yNow) to (xNext, yNext).

    Moves Figure from (xNow, yNow) to (xNext, yNext). If there is a (enemy) Figure at (xNext, yNext) it's going to be replaced.

    xNow

    x-value the Figure stands at the moment

    yNow

    y-value the Figure stands at the moment

    xNext

    x-value the Figure should move to

    yNext

    y-value the Figure should move to

    returns

    gameField

    Definition Classes
    GameFieldGameFieldInterface
  29. def moveToFieldAllowed(x: Int, y: Int, figure: Figure): Boolean

    Confirms if you set yourself into check with this move and whether the Figure at (x, y) is a king of the other Player

    Confirms if you set yourself into check with this move and whether the Figure at (x, y) is a king of the other Player

    x

    value of the field

    y

    value of the field

    figure

    you want to move

    returns

    true if you not set yourself into check and there is no king of the other Player

    Definition Classes
    GameFieldGameFieldInterface
  30. def moveValid(xNow: Int, yNow: Int, xNext: Int, yNext: Int): Boolean

    Confirms if right Player is moving.

    Confirms if right Player is moving. If true validates if the move is allowed by the set rules.

    xNow

    x-value the Figure stands at the moment

    yNow

    y-value the Figure stands at the moment

    xNext

    x-value the Figure should move to

    yNext

    y-value the Figure should move to

    returns

    true if the right Player is moving and if the move is valid, else false

    Definition Classes
    GameFieldGameFieldInterface
  31. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  32. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  33. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  34. def pawnHasReachedEnd(): Boolean

    Inspects if a Pawn of any color has reached the end of the field (y = 7 || y = 0)

    Inspects if a Pawn of any color has reached the end of the field (y = 7 || y = 0)

    returns

    true if a Pawn has reached the end, else false

    Definition Classes
    GameFieldGameFieldInterface
  35. def setPlayer(color: Color): Color

    Sets the Player who has to make his turn now (the valid Player)

    Sets the Player who has to make his turn now (the valid Player)

    color

    of the valid Player

    returns

    the old Player's Color

    Definition Classes
    GameFieldGameFieldInterface
  36. def setSelfIntoCheck(figure: Figure, xNext: Int, yNext: Int): Boolean

    Verifies if you set yourself into check by simulating that move and inspect if any figure of the enemy checks you.

    Verifies if you set yourself into check by simulating that move and inspect if any figure of the enemy checks you.

    figure

    you want to move

    xNext

    x-value the Figure should move to

    yNext

    y-value the Figure should move to

    returns

    true if a Player could check you after that move, else false

    Definition Classes
    GameFieldGameFieldInterface
  37. def setStatus(newState: Int): Unit

    Sets the status of the gameField/ ongoing Game

    Sets the status of the gameField/ ongoing Game

    Definition Classes
    GameFieldGameFieldInterface
  38. var status: Int
  39. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  40. def toString: String

    returns

    String representation of the gameField

    Definition Classes
    GameFieldGameFieldInterface → AnyRef → Any
  41. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  42. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  43. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  44. def wayToIsFreeDiagonal(xNow: Int, yNow: Int, xNext: Int, yNext: Int): Boolean

    Checks if there are no Figures on the diagonal way from (xNow, yNow) to (xNext, yNext).

    Checks if there are no Figures on the diagonal way from (xNow, yNow) to (xNext, yNext). Diagonal means if xNow = xNext + n and yNow = yNext + n. It will not verify if the cell at (xNext, yNext) is free!

    xNow

    x-value the Figure stands at the moment

    yNow

    y-value the Figure stands at the moment

    xNext

    x-value the Figure should move to

    yNext

    y-value the Figure should move to

    returns

    true if the way is free

    Definition Classes
    GameFieldGameFieldInterface
  45. def wayToIsFreeStraight(xNow: Int, yNow: Int, xNext: Int, yNext: Int): Boolean

    Checks if there are no Figures on the straight way from (xNow, yNow) to (xNext, yNext).

    Checks if there are no Figures on the straight way from (xNow, yNow) to (xNext, yNext). Straight means if xNow = xNext or yNow = yNext. It will not verify if the cell at (xNext, yNext) is free!

    xNow

    x-value the Figure stands at the moment

    yNow

    y-value the Figure stands at the moment

    xNext

    x-value the Figure should move to

    yNext

    y-value the Figure should move to

    returns

    true if the way is free

    Definition Classes
    GameFieldGameFieldInterface

Deprecated Value Members

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

Inherited from GameFieldInterface

Inherited from AnyRef

Inherited from Any

Ungrouped