Consider adding a doc comment for UnoException
1package de.wroracer.unoengine.exeptions;
2
3public class UnoException extends Exception {
4 public UnoException() { 5 super(); 6 } 7
8 public UnoException(String message) {
9 super(message);
Consider adding a doc comment for UnoException
5 super();
6 }
7
8 public UnoException(String message) { 9 super(message);10 }11
12 public UnoException(String message, Throwable cause) {
13 super(message, cause);
Consider adding a doc comment for UnoException
9 super(message);
10 }
11
12 public UnoException(String message, Throwable cause) {13 super(message, cause);14 }15
16 public UnoException(Throwable cause) {
17 super(cause);
Consider adding a doc comment for UnoException
13 super(message, cause);
14 }
15
16 public UnoException(Throwable cause) {17 super(cause);18 }19}
Consider adding a doc comment for PlayerHasNoCardException
5
6public class PlayerHasNoCardException extends UnoException{
7
8 public PlayerHasNoCardException(Player player, Card card) { 9 super("The Player "+player+" has´nt got the Card "+card);10 }11}
Consider adding a doc comment for NotPlayableCardException
4
5public class NotPlayableCardException extends UnoException{
6
7 public NotPlayableCardException(Card played,Card card) { 8 super("The Card "+played+" can not be Played on "+card); 9 }10}
Consider adding a doc comment for CantPlayBlackException
1package de.wroracer.unoengine.exeptions;
2
3public class CantPlayBlackException extends UnoException{
4 public CantPlayBlackException() {5 super("Cant Play Black Card.");6 }7}
Consider adding a doc comment for WildDrawFourCard
6public class WildDrawFourCard extends Card{
7 private final static int cardsToDraw = 4;
8 private int currentDrawCards = 0;
9 public WildDrawFourCard() {10 super(CardType.WILD, CardColor.BLACK);11 }12
13 @Override
14 public void setColor(CardColor color) {
Consider adding a doc comment for WildCard
4import de.wroracer.unoengine.Player;
5
6public class WildCard extends Card {
7 public WildCard() { 8 super(CardType.WILD, CardColor.BLACK); 9 }10
11 @Override
12 public void setColor(CardColor color) {
Consider adding a doc comment for SkipCard
4import de.wroracer.unoengine.Player;
5
6public class SkipCard extends Card{
7 public SkipCard( CardColor color) { 8 super(CardType.SKIP, color); 9 }10 @Override
11 public void setColor(CardColor color) {
12 super.setColor(color);
Consider adding a doc comment for ReverseCard
4import de.wroracer.unoengine.Player;
5
6public class ReverseCard extends Card{
7 public ReverseCard(CardColor color) { 8 super(CardType.REVERSE, color); 9 }10
11 @Override
12 public boolean isPlayable(Card card) {
Consider adding a doc comment for DrawTwoCard
6public class DrawTwoCard extends Card{
7 private final static int cardsToDraw = 2;
8 private int currentDrawCards = 0;
9 public DrawTwoCard(CardColor color) {10 super(CardType.DRAW_TWO, color);11 }12
13 @Override
14 public boolean isPlayable(Card card) {
Consider adding a doc comment for CardType
38 this.card = card;
39 }
40
41 CardType(String name,int number,Class<? extends Card> card){42 this.name = name;43 this.number = number;44 this.card = card;45 }46
47 public String getName() {
48 return name;
Consider adding a doc comment for CardType
33 private Class<? extends Card> card;
34 private int number = -1;
35
36 CardType(String name,Class<? extends Card> card){37 this.name = name;38 this.card = card;39 }40
41 CardType(String name,int number,Class<? extends Card> card){
42 this.name = name;
Consider adding a doc comment for CardColor
8 BLACK("black")
9 ;
10 private final String name;
11 CardColor(String name){12 this.name = name;13 }14
15 public String getName() {
16 return name;
Consider adding a doc comment for Card
6public class Card {
7 private CardColor color;
8 private CardType type;
9 public Card(CardType type,CardColor color){10 this.type = type;11 this.color = color;12 }13
14 public CardColor getColor() {
15 return color;
Consider adding a doc comment for Player
9 this.uuid = UUID.randomUUID();
10 }
11
12 protected Player(int id){13 this();14 this.id = id;15 }16
17 public UUID getUuid() {
18 return uuid;
Consider adding a doc comment for Player
5public class Player {
6 private UUID uuid;
7 private int id;
8 public Player(){ 9 this.uuid = UUID.randomUUID();10 }11
12 protected Player(int id){
13 this();
Description
This constructor does not have any documentation.
Consider adding a documentation comment to explain its use.
While it may seem like the usage of a constructor is perfectly obvious, any consumers of your API may not be able to pick up on certain details.
Bad Practice
In the example below, it is difficult to understand what the arguments of this constructor for DataForwarder
signify.
class DataForwarder {
public DataForwarder(int nTypes, String... values) {
// ...
}
}
Recommended
Document the constructor and provide useful information about it or its parameters as required.
/**
* Initializes a DataForwarder with a set of types to filter by, along with their names.
*
* @param nTypes - The number of types to filter by.
* @param values - The input type names to filter by.
*/
public DataForwarder(int nTypes, String... values) {
// ...
}
Exceptions
If you feel this constructor does not require documentation, you can add a skipcq comment to this constructor.