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 7e7e2344..218416a6 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 @@ -1,12 +1,41 @@ package pp.mdga.game; +/** + * 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. + */ public enum Color { + /** + * Represents the air force color. + */ AIRFORCE, + /** + * Represents the cyber color. + */ CYBER, + /** + * Represents the navy color. + */ NAVY, - ARMY; + /** + * Represents the army color. + */ + ARMY, + /** + * Represents the none color. + */ + NONE; + /** + * This method will be used to calculate the next color inside the sequence. + * + * @return color as a Color Enumeration. + */ public Color next() { + if (this.next() == NONE) { + return AIRFORCE; + } + return values()[(ordinal() + 1) % values().length]; } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/game/Player.java b/Projekte/mdga/model/src/main/java/pp/mdga/game/Player.java index c536438f..6029e396 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/game/Player.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/game/Player.java @@ -9,7 +9,7 @@ public class Player { private String name; private Statistic playerStatistic; private ArrayList handCards; - private Color color; + private Color color = Color.NONE; private boolean isReady; private boolean active = true;