457 });
458 }
459
460 public enum ResetType {461 ALL, SCORES, STATS462 }463}
5import java.util.Locale;
6import java.util.UUID;
7
8public enum PlayerStatType { 9 TOTAL_WINS, TOTAL_TRIES;1011 public static PlayerStat create(final UUID owner, final PlayerStatType playerStatType) {12 return create(owner, playerStatType, "0");13 }1415 public static PlayerStat create(final UUID owner, final PlayerStatType playerStatType, final String value) {16 switch (playerStatType.name()) {17 case "TOTAL_WINS":18 case "TOTAL_TRIES":19 return new SimplePlayerStat(playerStatType.name()20 .toLowerCase(Locale.ENGLISH), owner, Integer.parseInt(value));21 }22 return null;23 }2425 public static PlayerStatType match(final String statType) {26 switch (statType.toUpperCase(Locale.ENGLISH)){27 case "TOTAL_WINS":28 return PlayerStatType.TOTAL_WINS;29 case "TOTAL_TRIES":30 return PlayerStatType.TOTAL_TRIES;31 }32 return null;33 }34}
63 }
64 }
65
66 public enum PlayerFactoryType {67 REGULAR,68 DUMMY;69 }70}
241 this.globalMap.reset(playerUid);
242 }
243
244 public enum LeaderboardRetrieveType {245 GLOBAL, SESSION;246 }247}
248
249
34 }
35 }
36
37 public enum IslandSetupFactoryType {38 BUILD,39 SETUP;40 }41}
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.
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;
}
}
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 {
// ...
}