Direction class

Represents a direction on a chessboard.

Constructors

Direction(int h, int v)
const
Direction.fromSquareName(String name)
factory
Direction.fromString(String str)
factory

Properties

diagonal bool
Bishops move diagonally.
no setter
h int
Squares travelled horizontally.
final
hashCode int
The hash code for this object.
no setteroverride
oblique bool
Knights move obliquely.
no setter
orthogonal bool
Rooks move orthogonally.
no setter
permutations List<Direction>
A list of directions that occur from mirroring this Direction in both axes.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
simpleString String
no setter
type DirectionType
Whether this direction is orthogonal, diagonal, or oblique.
no setter
v int
Squares travelled vertically.
final

Methods

abs() Direction
Returns this direction in the positive direction of both axes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
translate(int x, int y) Direction
Returns a copy of this Direction, translated by x and y.

Operators

operator *(Object other) Direction
operator +(Direction other) Direction
operator -(Direction other) Direction
operator ==(Object other) bool
The equality operator.
override
operator unary-() Direction
operator ~/(Object other) Direction

Constants

none → const Direction
unit → const Direction