Modding:CardinalDirection: Difference between revisions

From SkyCorp Global
Jump to navigation Jump to search
(CardinalDirection exposed)
 
(Add parseFromCharacter())
 
Line 18: Line 18:


Case sensitive.
Case sensitive.
=== static CardinalDirection parseFromCharacter(character text) ===
Translate a character such as "N" to CardinalDirection.North
(Note, lua does not actually have a character type, so this is just a normal one character long string.)
Case insensitive.


== Public methods ==
== Public methods ==

Latest revision as of 02:40, 29 January 2026

This represents a specific map direction

Static values

Each of these is a CardinalDirection:

  • NORTH
  • EAST
  • SOUTH
  • WEST
  • WAIT (for pathfinding, route might still be calculating)
  • UNKNOWN (for pathfinding, cannot route to destination)

Static methods

static CardinalDirection parseDirection(string text)

Translate a string such as "NORTH" to CardinalDirection.North

Case sensitive.

static CardinalDirection parseFromCharacter(character text)

Translate a character such as "N" to CardinalDirection.North

(Note, lua does not actually have a character type, so this is just a normal one character long string.)

Case insensitive.

Public methods

string toString()

Translates a cardinal direction object to an upper case string

CardinalDirection clockwise()

Gets the direction clockwise from this direction

CardinalDirection counterClockwise()

Gets the direction counter-clockwise from this direction