Package org.hololink.position
Enum Direction
- java.lang.Object
-
- java.lang.Enum<Direction>
-
- org.hololink.position.Direction
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Direction>,java.lang.constant.Constable
public enum Direction extends java.lang.Enum<Direction>
UneDirectionest une énumération qui représente les directions cardinales.- NORTH
- EAST
- SOUTH
- WEST
shuffledpermet d'avoir un tableau de directions mélangé de manière aléatoire.
-
-
Method Summary
Modifier and Type Method Description intgetCol()intgetRow()static voidmain(java.lang.String[] args)static Direction[]shuffled()Mélange les directions aléatoirement.java.lang.StringtoString()DirectionturnAround()Tourne sur lui-mêmeDirectionturnLeft()Tourne vers la gauche.DirectionturnRight()Tourne vers la droite.static DirectionvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Direction[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static Direction[] values()
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Direction valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
turnRight
public Direction turnRight()
Tourne vers la droite.- Returns:
- La direction à droite de la direction courante.
-
turnAround
public Direction turnAround()
Tourne sur lui-même- Returns:
- La direction derrière la direction courante.
-
turnLeft
public Direction turnLeft()
Tourne vers la gauche.- Returns:
- La direction à gauche de la direction courante.
-
getRow
public int getRow()
-
getCol
public int getCol()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Enum<Direction>
-
shuffled
public static Direction[] shuffled()
Mélange les directions aléatoirement.- Returns:
- Tableau des 4 directions mélangées aléatoirement.
-
main
public static void main(java.lang.String[] args)
-
-