use of com.voxelgameslib.voxelgameslib.feature.features.TeamFeature in project VoxelGamesLibv2 by VoxelGamesLib.
the class AbstractGame method handleElo.
private void handleElo(@Nullable Team winnerTeam, @Nullable User winnerUser) {
boolean handled = false;
if (winnerTeam != null) {
try {
TeamFeature teamFeature = getActivePhase().getFeature(TeamFeature.class);
eloHandler.handleGameEnd(this, teamFeature);
handled = true;
} catch (NoSuchFeatureException ignored) {
}
}
if (!handled && winnerUser != null) {
try {
DuelFeature duelFeature = getActivePhase().getFeature(DuelFeature.class);
eloHandler.handleGameEnd(this, duelFeature, winnerUser);
handled = true;
} catch (NoSuchFeatureException ignored) {
}
}
if (!handled) {
if (winnerUser != null) {
eloHandler.handleGameEnd(this, winnerUser);
} else {
log.warning("Could not distribute any elo!");
}
}
}
Aggregations