diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/game/Color.java b/Projekte/mdga/model/src/main/java/pp/mdga/game/Color.java index 76d4e17b..0fd652c8 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/game/Color.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/game/Color.java @@ -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; + } }