Position

Position
class Position(x: Int, y: Int)

A position in the chess board.

Value parameters

x

The row value. Must be 0 <= x <= 7.

y

The column value. Must be 0 <= y <= 7

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def column: Int

Get column value.

Get column value.

Attributes

override def equals(x: Any): Boolean

Two positions are equals if both rows are the same and both columns are the same.

Two positions are equals if both rows are the same and both columns are the same.

Value parameters

x

The object to compare.

Attributes

Returns

The result of the equality.

Definition Classes
Any
def move(newRow: Int, newColumn: Int): Unit

Move the position to another square.

Move the position to another square.

Value parameters

newColumn

The new column.

newRow

The new row.

Attributes

def move(newPos: Position): Unit

Move the position to another square.

Move the position to another square.

Value parameters

newPos

The new position

Attributes

def row: Int

Get row value.

Get row value.

Attributes

Returns

Row value

override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any