- Added documentation for new EloManager methods
This commit is contained in:
parent
2887630cf8
commit
8e68d62356
@ -137,7 +137,10 @@ public class EloManager extends MiniDbClientPlugin<EloClientData>
|
||||
{
|
||||
_eloTeams.get(displayName).Winner = true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method for quickly checking if a player is banned from ranked games
|
||||
*/
|
||||
public boolean isRankBanned(int accountId)
|
||||
{
|
||||
boolean banExpired = System.currentTimeMillis() >= getRankBanExpiry(accountId);
|
||||
@ -151,17 +154,26 @@ public class EloManager extends MiniDbClientPlugin<EloClientData>
|
||||
}
|
||||
return !banExpired;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method for getting a player's remaining ranked game ban duration if applicable
|
||||
*/
|
||||
public long getRankBanExpiry(int accountId)
|
||||
{
|
||||
return _repository.getBanExpiry(accountId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method for banning a player from joining ranked games temporarily
|
||||
*/
|
||||
public void banFromRanked(int accountId)
|
||||
{
|
||||
_repository.addRankedBan(accountId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method called when game ends to calculate new Elo and award it
|
||||
*/
|
||||
public void endMatch(int gameId)
|
||||
{
|
||||
EloTeam teamWinner = null;
|
||||
@ -244,7 +256,10 @@ public class EloManager extends MiniDbClientPlugin<EloClientData>
|
||||
_minElo = minElo;
|
||||
_visual = visual;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Method for fetching the proper division for a given Elo value
|
||||
*/
|
||||
public static EloDivision getDivision(int elo)
|
||||
{
|
||||
for (EloDivision ed : EloDivision.values())
|
||||
@ -278,7 +293,10 @@ public class EloManager extends MiniDbClientPlugin<EloClientData>
|
||||
{
|
||||
return _disp;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method for fetching the Itemstack that represents a player's division and their progress in it
|
||||
*/
|
||||
public ItemStack getVisual(int elo)
|
||||
{
|
||||
ItemBuilder build = new ItemBuilder(_visual);
|
||||
|
Loading…
Reference in New Issue
Block a user