Updated 'Color' enum.

Updated the 'Color' enum by adjusting the JavaDocs and adding a new static method 'getColor(int)'
This commit is contained in:
Daniel Grigencha
2024-12-05 04:51:55 +01:00
parent 3a86837307
commit f90aed7bbb

View File

@@ -3,8 +3,8 @@
import com.jme3.network.serializing.Serializable;
/**
* This enumeration will be used to show the four different TSK which can be picked from a player.
* In Addition, the NONE color will be used to show a none color.
* This enumeration represents the four different TSK colors that a player can choose.
* Additionally, the NONE color indicates the absence of a color.
*/
@Serializable
public enum Color {
@@ -58,4 +58,19 @@ public Color next() {
return colors[nextIndex];
}
/**
* This method will be used to return the color of the given index.
*
* @param i as the index of the color as an Integer.
* @return a Color enumeration.
*/
public static Color getColor(int i) {
for (Color color : Color.values()) {
if (color.ordinal() == i) {
return color;
}
}
return null;
}
}