Consider adding a doc comment for CardType
4import java.util.List;
5import java.util.stream.Collectors;
6
7public enum CardType { 8 ZERO("zero",0,Card.class), 9 ONE("one",1,Card.class),10 TWO("two",2,Card.class),11 THREE("three",3,Card.class),12 FOUR("four",4,Card.class),13 FIVE("five",5,Card.class),14 SIX("six",6,Card.class),15 SEVEN("seven",7,Card.class),16 EIGHT("eight",8,Card.class),17 NINE("nine",9,Card.class),18 REVERSE("reverse",ReverseCard.class),19 DRAW_TWO("draw two",DrawTwoCard.class),20 SKIP("skip",SkipCard.class),21 WILD("wild",WildCard.class),22 WILD_DRAW_FOUR("wild draw four",WildDrawFourCard.class),23 ;2425 public static List<CardType> getNumbers(){26 return Arrays.stream(CardType.values()).filter(CardType::isNumber).collect(Collectors.toList());27 }28 public static List<CardType> getSpecials(){29 return Arrays.stream(CardType.values()).filter(c->!c.isNumber()).collect(Collectors.toList());30 }3132 private String name;33 private Class<? extends Card> card;34 private int number = -1;3536 CardType(String name,Class<? extends Card> card){37 this.name = name;38 this.card = card;39 }4041 CardType(String name,int number,Class<? extends Card> card){42 this.name = name;43 this.number = number;44 this.card = card;45 }4647 public String getName() {48 return name;49 }5051 public int getNumber() {52 return number;53 }5455 public boolean isNumber(){56 return number > -1;57 }5859 public Class<? extends Card> getCard() {60 return card;61 }62}
Consider adding a doc comment for CardColor
1package de.wroracer.unoengine.cards;
2
3public enum CardColor { 4 GREEN("green"), 5 RED("red"), 6 BLUE("blue"), 7 YELLOW("yellow"), 8 BLACK("black") 9 ;10 private final String name;11 CardColor(String name){12 this.name = name;13 }1415 public String getName() {16 return name;17 }18}
Consider adding a doc comment for Status
1package de.wroracer.unoengine;
2
3public enum Status {4 LOBBY(),5 IN_GAME(),6 ENDED()7}
Description
This declaration is not documented.
Consider adding a documentation comment to explain its functionality.
While it may seem like the functionality of this declaration is perfectly obvious, any consumers of your API or future maintainers may not be able to pick up on certain details.
Bad Practice
In the example below, the meaning of AUIHighlight
may not be entirely clear, and questions such as what AUI
means may pop up.
public enum AUIHighlight {
LIGHT_BLUE(0x00ADD8E6),
DARK_BLUE(0x0000008B),
// ...
private int value;
AUIHighlight(int val) {
value = val;
}
}
Recommended
Make sure to document any non-obvious details about any code element.
/**
* UI highlight color values for the action bar of the application.
*/
public enum AUIHighlight {
// ...
}