1414 */
1515interface KDAPIInterface {
1616 /**
17- * Get specific user's data
17+ * Get specific user's data. If data wasn't found, create new userdata.
1818 * @param uuid UUID of player
1919 * @param name Name of player
20+ * @return returns KDUserData.
21+ */
22+ @ NotNull
23+ KDUserData getOrCreateUserData (@ NotNull UUID uuid , @ NotNull String name );
24+
25+ /**
26+ * Get specific user's data
27+ * @param uuid UUID of player
2028 * @return returns KDUserData. If failed, returns null.
2129 */
2230 @ Nullable
23- KDUserData getUserData (@ NotNull UUID uuid , @ NotNull String name );
31+ KDUserData getUserData (@ NotNull UUID uuid );
2432
2533 /**
2634 * Get specific user's ranking
2735 * @param uuid UUID of player
28- * @param unit Name of player
36+ * @param unit Unit of ranking
2937 * @return returns ranking order. If failed, returns -1.
3038 */
3139 int getRank (@ NotNull UUID uuid , @ NotNull TimeUnit unit );
@@ -37,4 +45,28 @@ interface KDAPIInterface {
3745 * @return List of {@link KillRankingData}. If failed, returns empty list.
3846 */
3947 List <KillRankingData > getTopKillRankingData (@ NotNull TimeUnit unit , int maxSize );
48+
49+ // === Won't need to implement each ===
50+ /**
51+ * Get specific user's kill count
52+ * @param uuid UUID of player
53+ * @param unit Unit of ranking
54+ * @return returns kill count. If failed, returns -1.
55+ */
56+ default int getKills (@ NotNull UUID uuid , @ NotNull TimeUnit unit ) {
57+ var userdata = getUserData (uuid );
58+ if (userdata == null ) return -1 ;
59+ return userdata .getKills (unit );
60+ }
61+
62+ /**
63+ * Get specific user's death count
64+ * @param uuid UUID of player
65+ * @return returns total death count. If failed, returns -1
66+ */
67+ default int getDeaths (@ NotNull UUID uuid ) {
68+ var userdata = getUserData (uuid );
69+ if (userdata == null ) return -1 ;
70+ return userdata .getDeaths ();
71+ }
4072}
0 commit comments