updated enum 'Color'

This commit is contained in:
Daniel Grigencha
2024-12-01 15:54:06 +01:00
parent ed04bc1119
commit 772c7a51e0
2 changed files with 31 additions and 2 deletions

View File

@@ -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];
}
}

View File

@@ -9,7 +9,7 @@ public class Player {
private String name;
private Statistic playerStatistic;
private ArrayList<BonusCard> handCards;
private Color color;
private Color color = Color.NONE;
private boolean isReady;
private boolean active = true;