Direction

Methods
7
Fields
4

Getting one

Direction.valueOf(…)
Direction.NORTH
Direction.SOUTH

Methods

MethodReturnsDescription
name()stringThe constant's name as declared.
ordinal()numberThe constant's 0-based position in values().
toString()stringname(); tostring(c) answers the same.
compareTo(Direction)numberThis ordinal less other's.
equals(any)booleanWhether other is this constant. == answers the same.
values(){Direction}Every constant in ordinal order, as a 1-based array: the same frozen array every values() call, so table.clone it before changing it.
valueOf(string)DirectionvalueOf(name): the constant named name; any other name is an error.

Fields

FieldTypeDescription
NORTHDirectionNORTH: ordinal 0.
SOUTHDirectionSOUTH: ordinal 1.
EASTDirectionEAST: ordinal 2.
WESTDirectionWEST: ordinal 3.

Returned by

MethodReturnsDescription
Angle.getNearestDirectionDirectionThe cardinal Direction nearest this angle.
DirectionClass.valueOfDirectionvalueOf(name): the constant named name; any other name is an error.
DirectionClass.values{Direction}Every constant in ordinal order, as a 1-based array: the same frozen array every values() call, so table.clone it before changing it.

Method details

ordinal

ordinal: (Direction) -> number

The constant's 0-based position in values().

equals

equals: (Direction, any) -> boolean

Whether other is this constant. == answers the same.

values

values: () -> {Direction}

Every constant in ordinal order, as a 1-based array: the same frozen array every values() call, so table.clone it before changing it.

valueOf

valueOf: (string) -> Direction

valueOf(name): the constant named name; any other name is an error.