The type CompassDir
represents the cardinal compass directions in a grid-like coordinate
system. There are exactly four instances of this type: North
, East
, South
and West
,
which are also defined in this package.
All the CompassDir
objects are immutable.
This type and its instances have aliases in the top-level package o1, so they are
accessible to students simply via import o1.*
.
- Value parameters:
- xStep
the change in x coordinate if one moves one step in this direction. For instance,
West
has anxStep
of -1 andNorth
has anxStep
of 0.- yStep
the change in y coordinate if one moves one step in this direction. For instance,
North
has anyStep
of -1 andWest
has anyStep
of 0.
- See also:
- Companion:
- object
Type members
Enum entries
This immutable singleton object represents the eastwardly compass direction.
It’s one of the four predefined instances of CompassDir
. It has an alias in the
top-level package o1, so it’s accessible to students simply via import o1.*
.
This immutable singleton object represents the eastwardly compass direction.
It’s one of the four predefined instances of CompassDir
. It has an alias in the
top-level package o1, so it’s accessible to students simply via import o1.*
.
This immutable singleton object represents the northwardly compass direction.
It’s one of the four predefined instances of CompassDir
. It has an alias in the
top-level package o1, so it’s accessible to students simply via import o1.*
.
This immutable singleton object represents the northwardly compass direction.
It’s one of the four predefined instances of CompassDir
. It has an alias in the
top-level package o1, so it’s accessible to students simply via import o1.*
.
This immutable singleton object represents the southwardly compass direction.
It’s one of the four predefined instances of CompassDir
. It has an alias in the
top-level package o1, so it’s accessible to students simply via import o1.*
.
This immutable singleton object represents the southwardly compass direction.
It’s one of the four predefined instances of CompassDir
. It has an alias in the
top-level package o1, so it’s accessible to students simply via import o1.*
.
This immutable singleton object represents the westwardly compass direction.
It’s one of the four predefined instances of CompassDir
. It has an alias in the
top-level package o1, so it’s accessible to students simply via import o1.*
.
This immutable singleton object represents the westwardly compass direction.
It’s one of the four predefined instances of CompassDir
. It has an alias in the
top-level package o1, so it’s accessible to students simply via import o1.*
.