- Added documentation for new EloManager methods

This commit is contained in:
AlexTheCoder 2016-04-28 21:16:18 -04:00
parent 2887630cf8
commit 8e68d62356

View File

@ -138,6 +138,9 @@ 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);
@ -152,16 +155,25 @@ 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;
@ -245,6 +257,9 @@ public class EloManager extends MiniDbClientPlugin<EloClientData>
_visual = visual;
}
/*
* Method for fetching the proper division for a given Elo value
*/
public static EloDivision getDivision(int elo)
{
for (EloDivision ed : EloDivision.values())
@ -279,6 +294,9 @@ 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);