Skip to content

Commit dfcdd3e

Browse files
committed
feat: add wrapper method for easy api implementation
1 parent 7af89a5 commit dfcdd3e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/main/java/jp/azisaba/lgw/kdstatus/api/KDAPIInterface.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,28 @@ interface KDAPIInterface {
4545
* @return List of {@link KillRankingData}. If failed, returns empty list.
4646
*/
4747
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+
}
4872
}

0 commit comments

Comments
 (0)