From 38a079846d39fe20ac62a38120484cdfbac18521 Mon Sep 17 00:00:00 2001 From: Joseph Prezioso Jr Date: Mon, 28 Mar 2016 18:14:52 -0400 Subject: [PATCH] Some basic ideas for Elo I will be experimenting with --- .../src/mineplex/core/elo/EloManager.java | 23 +++++++++++++++++++ .../src/mineplex/core/elo/EloPlayer.java | 4 ++++ 2 files changed, 27 insertions(+) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/elo/EloManager.java b/Plugins/Mineplex.Core/src/mineplex/core/elo/EloManager.java index d1c44b6d6..cceb3b082 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/elo/EloManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/elo/EloManager.java @@ -2,6 +2,7 @@ package mineplex.core.elo; import java.sql.ResultSet; import java.sql.SQLException; +import java.util.ArrayList; import java.util.UUID; import mineplex.core.MiniDbClientPlugin; @@ -46,6 +47,28 @@ public class EloManager extends MiniDbClientPlugin return elo; } + //get a player's Division + public String getPlayerDivision(UUID uuid, String gameType) + { + String updatedDivision = ""; + + //get playerElo for gametype (need to store this to check it against other Elo's) + int playerElo = getElo(uuid, gameType); + //this list will be filled with ELO's from other players (but only for the same game type + ArrayList otherElos = new ArrayList(); + + for(int i = 0; i < _playerElos.size(); i++) + { + //we're only concerned with this Game Type + if(_playerElos.containsKey(gameType)) + { + + } + } + + return updatedDivision; + } + public EloTeam getNewRatings(EloTeam teamA, EloTeam teamB, GameResult result) { EloTeam newTeam = new EloTeam(); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/elo/EloPlayer.java b/Plugins/Mineplex.Core/src/mineplex/core/elo/EloPlayer.java index a2661fee3..61c8ad014 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/elo/EloPlayer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/elo/EloPlayer.java @@ -5,8 +5,12 @@ public class EloPlayer public String UniqueId; public int Rating; + //Division stuff (to be implemented, pending review) + private String _division; + public void printInfo() { System.out.println(UniqueId + "'s elo is " + Rating); } + }