updated enum 'Color'
This commit is contained in:
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user