Move hiscore client to rl-client
Thie removes the http-service hiscore api, which we haven't used in awhile and doesn't work in practice due to upstream rate limits, as well as the xp tracker which also hasn't been used in a long time since there are now multiple quality community run xptrackers.
This commit is contained in:
@@ -58,11 +58,6 @@
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-csv</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Adam <Adam@sigterm.info>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.http.api.hiscore;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.apache.commons.csv.CSVFormat;
|
||||
import org.apache.commons.csv.CSVParser;
|
||||
import org.apache.commons.csv.CSVRecord;
|
||||
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class HiscoreClient
|
||||
{
|
||||
private final OkHttpClient client;
|
||||
|
||||
public HiscoreResult lookup(String username, HiscoreEndpoint endpoint) throws IOException
|
||||
{
|
||||
return lookup(username, endpoint.getHiscoreURL());
|
||||
}
|
||||
|
||||
public CompletableFuture<HiscoreResult> lookupAsync(String username, HiscoreEndpoint endpoint)
|
||||
{
|
||||
return lookupAsync(username, endpoint.getHiscoreURL());
|
||||
}
|
||||
|
||||
public HiscoreResult lookup(String username, HttpUrl endpoint) throws IOException
|
||||
{
|
||||
return lookupSync(username, endpoint);
|
||||
}
|
||||
|
||||
public HiscoreResult lookup(String username) throws IOException
|
||||
{
|
||||
return lookup(username, HiscoreEndpoint.NORMAL);
|
||||
}
|
||||
|
||||
public SingleHiscoreSkillResult lookup(String username, HiscoreSkill skill, HiscoreEndpoint endpoint) throws IOException
|
||||
{
|
||||
HiscoreResult result = lookupSync(username, endpoint.getHiscoreURL());
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Skill requested = result.getSkill(skill);
|
||||
SingleHiscoreSkillResult skillResult = new SingleHiscoreSkillResult();
|
||||
skillResult.setPlayer(username);
|
||||
skillResult.setSkillName(skill.getName());
|
||||
skillResult.setSkill(requested);
|
||||
return skillResult;
|
||||
}
|
||||
|
||||
public SingleHiscoreSkillResult lookup(String username, HiscoreSkill skill) throws IOException
|
||||
{
|
||||
return lookup(username, skill, HiscoreEndpoint.NORMAL);
|
||||
}
|
||||
|
||||
private HiscoreResult lookupSync(String username, HttpUrl hiscoreUrl) throws IOException
|
||||
{
|
||||
try (Response response = client.newCall(buildRequest(username, hiscoreUrl)).execute())
|
||||
{
|
||||
return processResponse(username, response);
|
||||
}
|
||||
}
|
||||
|
||||
private CompletableFuture<HiscoreResult> lookupAsync(String username, HttpUrl hiscoreUrl)
|
||||
{
|
||||
CompletableFuture<HiscoreResult> future = new CompletableFuture<>();
|
||||
|
||||
client.newCall(buildRequest(username, hiscoreUrl)).enqueue(new Callback()
|
||||
{
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e)
|
||||
{
|
||||
future.completeExceptionally(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException
|
||||
{
|
||||
try
|
||||
{
|
||||
future.complete(processResponse(username, response));
|
||||
}
|
||||
finally
|
||||
{
|
||||
response.close();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return future;
|
||||
}
|
||||
|
||||
private static Request buildRequest(String username, HttpUrl hiscoreUrl)
|
||||
{
|
||||
HttpUrl url = hiscoreUrl.newBuilder()
|
||||
.addQueryParameter("player", username)
|
||||
.build();
|
||||
|
||||
log.debug("Built URL {}", url);
|
||||
|
||||
return new Request.Builder()
|
||||
.url(url)
|
||||
.build();
|
||||
}
|
||||
|
||||
private static HiscoreResult processResponse(String username, Response response) throws IOException
|
||||
{
|
||||
if (!response.isSuccessful())
|
||||
{
|
||||
if (response.code() == 404)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
throw new IOException("Error retrieving data from Jagex Hiscores: " + response);
|
||||
}
|
||||
|
||||
String responseStr = response.body().string();
|
||||
return parseResponse(username, responseStr);
|
||||
}
|
||||
|
||||
private static HiscoreResult parseResponse(String username, String responseStr) throws IOException
|
||||
{
|
||||
CSVParser parser = CSVParser.parse(responseStr, CSVFormat.DEFAULT);
|
||||
|
||||
HiscoreResultBuilder hiscoreBuilder = new HiscoreResultBuilder();
|
||||
hiscoreBuilder.setPlayer(username);
|
||||
|
||||
int count = 0;
|
||||
|
||||
for (CSVRecord record : parser.getRecords())
|
||||
{
|
||||
if (count++ >= HiscoreSkill.values().length)
|
||||
{
|
||||
log.warn("Jagex Hiscore API returned unexpected data");
|
||||
break; // rest is other things?
|
||||
}
|
||||
|
||||
// rank, level, experience
|
||||
int rank = Integer.parseInt(record.get(0));
|
||||
int level = Integer.parseInt(record.get(1));
|
||||
|
||||
// items that are not skills do not have an experience parameter
|
||||
long experience = -1;
|
||||
if (record.size() == 3)
|
||||
{
|
||||
experience = Long.parseLong(record.get(2));
|
||||
}
|
||||
|
||||
Skill skill = new Skill(rank, level, experience);
|
||||
hiscoreBuilder.setNextSkill(skill);
|
||||
}
|
||||
|
||||
return hiscoreBuilder.build();
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Adam <Adam@sigterm.info>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.runelite.http.api.hiscore;
|
||||
|
||||
import lombok.Getter;
|
||||
import okhttp3.HttpUrl;
|
||||
|
||||
@Getter
|
||||
public enum HiscoreEndpoint
|
||||
{
|
||||
NORMAL("Normal", "https://services.runescape.com/m=hiscore_oldschool/index_lite.ws"),
|
||||
IRONMAN("Ironman", "https://services.runescape.com/m=hiscore_oldschool_ironman/index_lite.ws"),
|
||||
HARDCORE_IRONMAN("Hardcore Ironman", "https://services.runescape.com/m=hiscore_oldschool_hardcore_ironman/index_lite.ws"),
|
||||
ULTIMATE_IRONMAN("Ultimate Ironman", "https://services.runescape.com/m=hiscore_oldschool_ultimate/index_lite.ws"),
|
||||
DEADMAN("Deadman", "https://services.runescape.com/m=hiscore_oldschool_deadman/index_lite.ws"),
|
||||
LEAGUE("Leagues", "https://services.runescape.com/m=hiscore_oldschool_seasonal/index_lite.ws"),
|
||||
TOURNAMENT("Tournament", "https://services.runescape.com/m=hiscore_oldschool_tournament/index_lite.ws");
|
||||
|
||||
private final String name;
|
||||
private final HttpUrl hiscoreURL;
|
||||
|
||||
HiscoreEndpoint(String name, String hiscoreURL)
|
||||
{
|
||||
this.name = name;
|
||||
this.hiscoreURL = HttpUrl.parse(hiscoreURL);
|
||||
}
|
||||
}
|
||||
@@ -1,294 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Adam <Adam@sigterm.info>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.http.api.hiscore;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HiscoreResult
|
||||
{
|
||||
private String player;
|
||||
private Skill overall;
|
||||
private Skill attack;
|
||||
private Skill defence;
|
||||
private Skill strength;
|
||||
private Skill hitpoints;
|
||||
private Skill ranged;
|
||||
private Skill prayer;
|
||||
private Skill magic;
|
||||
private Skill cooking;
|
||||
private Skill woodcutting;
|
||||
private Skill fletching;
|
||||
private Skill fishing;
|
||||
private Skill firemaking;
|
||||
private Skill crafting;
|
||||
private Skill smithing;
|
||||
private Skill mining;
|
||||
private Skill herblore;
|
||||
private Skill agility;
|
||||
private Skill thieving;
|
||||
private Skill slayer;
|
||||
private Skill farming;
|
||||
private Skill runecraft;
|
||||
private Skill hunter;
|
||||
private Skill construction;
|
||||
private Skill leaguePoints;
|
||||
private Skill bountyHunterHunter;
|
||||
private Skill bountyHunterRogue;
|
||||
private Skill clueScrollAll;
|
||||
private Skill clueScrollBeginner;
|
||||
private Skill clueScrollEasy;
|
||||
private Skill clueScrollMedium;
|
||||
private Skill clueScrollHard;
|
||||
private Skill clueScrollElite;
|
||||
private Skill clueScrollMaster;
|
||||
private Skill lastManStanding;
|
||||
private Skill soulWarsZeal;
|
||||
private Skill abyssalSire;
|
||||
private Skill alchemicalHydra;
|
||||
private Skill barrowsChests;
|
||||
private Skill bryophyta;
|
||||
private Skill callisto;
|
||||
private Skill cerberus;
|
||||
private Skill chambersOfXeric;
|
||||
private Skill chambersOfXericChallengeMode;
|
||||
private Skill chaosElemental;
|
||||
private Skill chaosFanatic;
|
||||
private Skill commanderZilyana;
|
||||
private Skill corporealBeast;
|
||||
private Skill crazyArchaeologist;
|
||||
private Skill dagannothPrime;
|
||||
private Skill dagannothRex;
|
||||
private Skill dagannothSupreme;
|
||||
private Skill derangedArchaeologist;
|
||||
private Skill generalGraardor;
|
||||
private Skill giantMole;
|
||||
private Skill grotesqueGuardians;
|
||||
private Skill hespori;
|
||||
private Skill kalphiteQueen;
|
||||
private Skill kingBlackDragon;
|
||||
private Skill kraken;
|
||||
private Skill kreearra;
|
||||
private Skill krilTsutsaroth;
|
||||
private Skill mimic;
|
||||
private Skill nex;
|
||||
private Skill nightmare;
|
||||
private Skill phosanisNightmare;
|
||||
private Skill obor;
|
||||
private Skill sarachnis;
|
||||
private Skill scorpia;
|
||||
private Skill skotizo;
|
||||
private Skill tempoross;
|
||||
private Skill gauntlet;
|
||||
private Skill corruptedGauntlet;
|
||||
private Skill theatreOfBlood;
|
||||
private Skill theatreOfBloodHardMode;
|
||||
private Skill thermonuclearSmokeDevil;
|
||||
private Skill tzKalZuk;
|
||||
private Skill tzTokJad;
|
||||
private Skill venenatis;
|
||||
private Skill vetion;
|
||||
private Skill vorkath;
|
||||
private Skill wintertodt;
|
||||
private Skill zalcano;
|
||||
private Skill zulrah;
|
||||
|
||||
public Skill getSkill(HiscoreSkill skill)
|
||||
{
|
||||
switch (skill)
|
||||
{
|
||||
case ATTACK:
|
||||
return getAttack();
|
||||
case DEFENCE:
|
||||
return getDefence();
|
||||
case STRENGTH:
|
||||
return getStrength();
|
||||
case HITPOINTS:
|
||||
return getHitpoints();
|
||||
case RANGED:
|
||||
return getRanged();
|
||||
case PRAYER:
|
||||
return getPrayer();
|
||||
case MAGIC:
|
||||
return getMagic();
|
||||
case COOKING:
|
||||
return getCooking();
|
||||
case WOODCUTTING:
|
||||
return getWoodcutting();
|
||||
case FLETCHING:
|
||||
return getFletching();
|
||||
case FISHING:
|
||||
return getFishing();
|
||||
case FIREMAKING:
|
||||
return getFiremaking();
|
||||
case CRAFTING:
|
||||
return getCrafting();
|
||||
case SMITHING:
|
||||
return getSmithing();
|
||||
case MINING:
|
||||
return getMining();
|
||||
case HERBLORE:
|
||||
return getHerblore();
|
||||
case AGILITY:
|
||||
return getAgility();
|
||||
case THIEVING:
|
||||
return getThieving();
|
||||
case SLAYER:
|
||||
return getSlayer();
|
||||
case FARMING:
|
||||
return getFarming();
|
||||
case RUNECRAFT:
|
||||
return getRunecraft();
|
||||
case HUNTER:
|
||||
return getHunter();
|
||||
case CONSTRUCTION:
|
||||
return getConstruction();
|
||||
case LEAGUE_POINTS:
|
||||
return getLeaguePoints();
|
||||
case OVERALL:
|
||||
return getOverall();
|
||||
case BOUNTY_HUNTER_HUNTER:
|
||||
return getBountyHunterHunter();
|
||||
case BOUNTY_HUNTER_ROGUE:
|
||||
return getBountyHunterRogue();
|
||||
case CLUE_SCROLL_ALL:
|
||||
return getClueScrollAll();
|
||||
case CLUE_SCROLL_BEGINNER:
|
||||
return getClueScrollBeginner();
|
||||
case CLUE_SCROLL_EASY:
|
||||
return getClueScrollEasy();
|
||||
case CLUE_SCROLL_MEDIUM:
|
||||
return getClueScrollMedium();
|
||||
case CLUE_SCROLL_HARD:
|
||||
return getClueScrollHard();
|
||||
case CLUE_SCROLL_ELITE:
|
||||
return getClueScrollElite();
|
||||
case CLUE_SCROLL_MASTER:
|
||||
return getClueScrollMaster();
|
||||
case LAST_MAN_STANDING:
|
||||
return getLastManStanding();
|
||||
case SOUL_WARS_ZEAL:
|
||||
return getSoulWarsZeal();
|
||||
case ABYSSAL_SIRE:
|
||||
return abyssalSire;
|
||||
case ALCHEMICAL_HYDRA:
|
||||
return alchemicalHydra;
|
||||
case BARROWS_CHESTS:
|
||||
return barrowsChests;
|
||||
case BRYOPHYTA:
|
||||
return bryophyta;
|
||||
case CALLISTO:
|
||||
return callisto;
|
||||
case CERBERUS:
|
||||
return cerberus;
|
||||
case CHAMBERS_OF_XERIC:
|
||||
return chambersOfXeric;
|
||||
case CHAMBERS_OF_XERIC_CHALLENGE_MODE:
|
||||
return chambersOfXericChallengeMode;
|
||||
case CHAOS_ELEMENTAL:
|
||||
return chaosElemental;
|
||||
case CHAOS_FANATIC:
|
||||
return chaosFanatic;
|
||||
case COMMANDER_ZILYANA:
|
||||
return commanderZilyana;
|
||||
case CORPOREAL_BEAST:
|
||||
return corporealBeast;
|
||||
case CRAZY_ARCHAEOLOGIST:
|
||||
return crazyArchaeologist;
|
||||
case DAGANNOTH_PRIME:
|
||||
return dagannothPrime;
|
||||
case DAGANNOTH_REX:
|
||||
return dagannothRex;
|
||||
case DAGANNOTH_SUPREME:
|
||||
return dagannothSupreme;
|
||||
case DERANGED_ARCHAEOLOGIST:
|
||||
return derangedArchaeologist;
|
||||
case GENERAL_GRAARDOR:
|
||||
return generalGraardor;
|
||||
case GIANT_MOLE:
|
||||
return giantMole;
|
||||
case GROTESQUE_GUARDIANS:
|
||||
return grotesqueGuardians;
|
||||
case HESPORI:
|
||||
return hespori;
|
||||
case KALPHITE_QUEEN:
|
||||
return kalphiteQueen;
|
||||
case KING_BLACK_DRAGON:
|
||||
return kingBlackDragon;
|
||||
case KRAKEN:
|
||||
return kraken;
|
||||
case KREEARRA:
|
||||
return kreearra;
|
||||
case KRIL_TSUTSAROTH:
|
||||
return krilTsutsaroth;
|
||||
case MIMIC:
|
||||
return mimic;
|
||||
case NEX:
|
||||
return nex;
|
||||
case NIGHTMARE:
|
||||
return nightmare;
|
||||
case PHOSANIS_NIGHTMARE:
|
||||
return phosanisNightmare;
|
||||
case OBOR:
|
||||
return obor;
|
||||
case SARACHNIS:
|
||||
return sarachnis;
|
||||
case SCORPIA:
|
||||
return scorpia;
|
||||
case SKOTIZO:
|
||||
return skotizo;
|
||||
case TEMPOROSS:
|
||||
return tempoross;
|
||||
case THE_GAUNTLET:
|
||||
return gauntlet;
|
||||
case THE_CORRUPTED_GAUNTLET:
|
||||
return corruptedGauntlet;
|
||||
case THEATRE_OF_BLOOD:
|
||||
return theatreOfBlood;
|
||||
case THEATRE_OF_BLOOD_HARD_MODE:
|
||||
return theatreOfBloodHardMode;
|
||||
case THERMONUCLEAR_SMOKE_DEVIL:
|
||||
return thermonuclearSmokeDevil;
|
||||
case TZKAL_ZUK:
|
||||
return tzKalZuk;
|
||||
case TZTOK_JAD:
|
||||
return tzTokJad;
|
||||
case VENENATIS:
|
||||
return venenatis;
|
||||
case VETION:
|
||||
return vetion;
|
||||
case VORKATH:
|
||||
return vorkath;
|
||||
case WINTERTODT:
|
||||
return wintertodt;
|
||||
case ZALCANO:
|
||||
return zalcano;
|
||||
case ZULRAH:
|
||||
return zulrah;
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid hiscore skill");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Adam <Adam@sigterm.info>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.http.api.hiscore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
class HiscoreResultBuilder
|
||||
{
|
||||
private String player;
|
||||
private final List<Skill> skills = new ArrayList<>();
|
||||
|
||||
public void setPlayer(String player)
|
||||
{
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
void setNextSkill(Skill skill)
|
||||
{
|
||||
skills.add(skill);
|
||||
}
|
||||
|
||||
public Skill getSkill(int index)
|
||||
{
|
||||
return skills.get(index);
|
||||
}
|
||||
|
||||
public HiscoreResult build()
|
||||
{
|
||||
HiscoreResult hiscoreResult = new HiscoreResult();
|
||||
hiscoreResult.setPlayer(player);
|
||||
int index = 0;
|
||||
hiscoreResult.setOverall(skills.get(index++));
|
||||
hiscoreResult.setAttack(skills.get(index++));
|
||||
hiscoreResult.setDefence(skills.get(index++));
|
||||
hiscoreResult.setStrength(skills.get(index++));
|
||||
hiscoreResult.setHitpoints(skills.get(index++));
|
||||
hiscoreResult.setRanged(skills.get(index++));
|
||||
hiscoreResult.setPrayer(skills.get(index++));
|
||||
hiscoreResult.setMagic(skills.get(index++));
|
||||
hiscoreResult.setCooking(skills.get(index++));
|
||||
hiscoreResult.setWoodcutting(skills.get(index++));
|
||||
hiscoreResult.setFletching(skills.get(index++));
|
||||
hiscoreResult.setFishing(skills.get(index++));
|
||||
hiscoreResult.setFiremaking(skills.get(index++));
|
||||
hiscoreResult.setCrafting(skills.get(index++));
|
||||
hiscoreResult.setSmithing(skills.get(index++));
|
||||
hiscoreResult.setMining(skills.get(index++));
|
||||
hiscoreResult.setHerblore(skills.get(index++));
|
||||
hiscoreResult.setAgility(skills.get(index++));
|
||||
hiscoreResult.setThieving(skills.get(index++));
|
||||
hiscoreResult.setSlayer(skills.get(index++));
|
||||
hiscoreResult.setFarming(skills.get(index++));
|
||||
hiscoreResult.setRunecraft(skills.get(index++));
|
||||
hiscoreResult.setHunter(skills.get(index++));
|
||||
hiscoreResult.setConstruction(skills.get(index++));
|
||||
hiscoreResult.setLeaguePoints(skills.get(index++));
|
||||
hiscoreResult.setBountyHunterHunter(skills.get(index++));
|
||||
hiscoreResult.setBountyHunterRogue(skills.get(index++));
|
||||
hiscoreResult.setClueScrollAll(skills.get(index++));
|
||||
hiscoreResult.setClueScrollBeginner(skills.get(index++));
|
||||
hiscoreResult.setClueScrollEasy(skills.get(index++));
|
||||
hiscoreResult.setClueScrollMedium(skills.get(index++));
|
||||
hiscoreResult.setClueScrollHard(skills.get(index++));
|
||||
hiscoreResult.setClueScrollElite(skills.get(index++));
|
||||
hiscoreResult.setClueScrollMaster(skills.get(index++));
|
||||
hiscoreResult.setLastManStanding(skills.get(index++));
|
||||
hiscoreResult.setSoulWarsZeal(skills.get(index++));
|
||||
// seasonal doesn't have boss hiscores
|
||||
if (index < skills.size())
|
||||
{
|
||||
hiscoreResult.setAbyssalSire(skills.get(index++));
|
||||
hiscoreResult.setAlchemicalHydra(skills.get(index++));
|
||||
hiscoreResult.setBarrowsChests(skills.get(index++));
|
||||
hiscoreResult.setBryophyta(skills.get(index++));
|
||||
hiscoreResult.setCallisto(skills.get(index++));
|
||||
hiscoreResult.setCerberus(skills.get(index++));
|
||||
hiscoreResult.setChambersOfXeric(skills.get(index++));
|
||||
hiscoreResult.setChambersOfXericChallengeMode(skills.get(index++));
|
||||
hiscoreResult.setChaosElemental(skills.get(index++));
|
||||
hiscoreResult.setChaosFanatic(skills.get(index++));
|
||||
hiscoreResult.setCommanderZilyana(skills.get(index++));
|
||||
hiscoreResult.setCorporealBeast(skills.get(index++));
|
||||
hiscoreResult.setCrazyArchaeologist(skills.get(index++));
|
||||
hiscoreResult.setDagannothPrime(skills.get(index++));
|
||||
hiscoreResult.setDagannothRex(skills.get(index++));
|
||||
hiscoreResult.setDagannothSupreme(skills.get(index++));
|
||||
hiscoreResult.setDerangedArchaeologist(skills.get(index++));
|
||||
hiscoreResult.setGeneralGraardor(skills.get(index++));
|
||||
hiscoreResult.setGiantMole(skills.get(index++));
|
||||
hiscoreResult.setGrotesqueGuardians(skills.get(index++));
|
||||
hiscoreResult.setHespori(skills.get(index++));
|
||||
hiscoreResult.setKalphiteQueen(skills.get(index++));
|
||||
hiscoreResult.setKingBlackDragon(skills.get(index++));
|
||||
hiscoreResult.setKraken(skills.get(index++));
|
||||
hiscoreResult.setKreearra(skills.get(index++));
|
||||
hiscoreResult.setKrilTsutsaroth(skills.get(index++));
|
||||
hiscoreResult.setMimic(skills.get(index++));
|
||||
if (skills.size() > 83)
|
||||
{
|
||||
hiscoreResult.setNex(skills.get(index++));
|
||||
}
|
||||
hiscoreResult.setNightmare(skills.get(index++));
|
||||
hiscoreResult.setPhosanisNightmare(skills.get(index++));
|
||||
hiscoreResult.setObor(skills.get(index++));
|
||||
hiscoreResult.setSarachnis(skills.get(index++));
|
||||
hiscoreResult.setScorpia(skills.get(index++));
|
||||
hiscoreResult.setSkotizo(skills.get(index++));
|
||||
hiscoreResult.setTempoross(skills.get(index++));
|
||||
hiscoreResult.setGauntlet(skills.get(index++));
|
||||
hiscoreResult.setCorruptedGauntlet(skills.get(index++));
|
||||
hiscoreResult.setTheatreOfBlood(skills.get(index++));
|
||||
hiscoreResult.setTheatreOfBloodHardMode(skills.get(index++));
|
||||
hiscoreResult.setThermonuclearSmokeDevil(skills.get(index++));
|
||||
hiscoreResult.setTzKalZuk(skills.get(index++));
|
||||
hiscoreResult.setTzTokJad(skills.get(index++));
|
||||
hiscoreResult.setVenenatis(skills.get(index++));
|
||||
hiscoreResult.setVetion(skills.get(index++));
|
||||
hiscoreResult.setVorkath(skills.get(index++));
|
||||
hiscoreResult.setWintertodt(skills.get(index++));
|
||||
hiscoreResult.setZalcano(skills.get(index++));
|
||||
hiscoreResult.setZulrah(skills.get(index++));
|
||||
}
|
||||
return hiscoreResult;
|
||||
}
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Adam <Adam@sigterm.info>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.http.api.hiscore;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import static net.runelite.http.api.hiscore.HiscoreSkillType.SKILL;
|
||||
import static net.runelite.http.api.hiscore.HiscoreSkillType.ACTIVITY;
|
||||
import static net.runelite.http.api.hiscore.HiscoreSkillType.BOSS;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum HiscoreSkill
|
||||
{
|
||||
OVERALL("Overall", HiscoreSkillType.OVERALL),
|
||||
ATTACK("Attack", SKILL),
|
||||
DEFENCE("Defence", SKILL),
|
||||
STRENGTH("Strength", SKILL),
|
||||
HITPOINTS("Hitpoints", SKILL),
|
||||
RANGED("Ranged", SKILL),
|
||||
PRAYER("Prayer", SKILL),
|
||||
MAGIC("Magic", SKILL),
|
||||
COOKING("Cooking", SKILL),
|
||||
WOODCUTTING("Woodcutting", SKILL),
|
||||
FLETCHING("Fletching", SKILL),
|
||||
FISHING("Fishing", SKILL),
|
||||
FIREMAKING("Firemaking", SKILL),
|
||||
CRAFTING("Crafting", SKILL),
|
||||
SMITHING("Smithing", SKILL),
|
||||
MINING("Mining", SKILL),
|
||||
HERBLORE("Herblore", SKILL),
|
||||
AGILITY("Agility", SKILL),
|
||||
THIEVING("Thieving", SKILL),
|
||||
SLAYER("Slayer", SKILL),
|
||||
FARMING("Farming", SKILL),
|
||||
RUNECRAFT("Runecraft", SKILL),
|
||||
HUNTER("Hunter", SKILL),
|
||||
CONSTRUCTION("Construction", SKILL),
|
||||
LEAGUE_POINTS("League Points", ACTIVITY),
|
||||
BOUNTY_HUNTER_HUNTER("Bounty Hunter - Hunter", ACTIVITY),
|
||||
BOUNTY_HUNTER_ROGUE("Bounty Hunter - Rogue", ACTIVITY),
|
||||
CLUE_SCROLL_ALL("Clue Scrolls (all)", ACTIVITY),
|
||||
CLUE_SCROLL_BEGINNER("Clue Scrolls (beginner)", ACTIVITY),
|
||||
CLUE_SCROLL_EASY("Clue Scrolls (easy)", ACTIVITY),
|
||||
CLUE_SCROLL_MEDIUM("Clue Scrolls (medium)", ACTIVITY),
|
||||
CLUE_SCROLL_HARD("Clue Scrolls (hard)", ACTIVITY),
|
||||
CLUE_SCROLL_ELITE("Clue Scrolls (elite)", ACTIVITY),
|
||||
CLUE_SCROLL_MASTER("Clue Scrolls (master)", ACTIVITY),
|
||||
LAST_MAN_STANDING("Last Man Standing", ACTIVITY),
|
||||
SOUL_WARS_ZEAL("Soul Wars Zeal", ACTIVITY),
|
||||
ABYSSAL_SIRE("Abyssal Sire", BOSS),
|
||||
ALCHEMICAL_HYDRA("Alchemical Hydra", BOSS),
|
||||
BARROWS_CHESTS("Barrows Chests", BOSS),
|
||||
BRYOPHYTA("Bryophyta", BOSS),
|
||||
CALLISTO("Callisto", BOSS),
|
||||
CERBERUS("Cerberus", BOSS),
|
||||
CHAMBERS_OF_XERIC("Chambers of Xeric", BOSS),
|
||||
CHAMBERS_OF_XERIC_CHALLENGE_MODE("Chambers of Xeric: Challenge Mode", BOSS),
|
||||
CHAOS_ELEMENTAL("Chaos Elemental", BOSS),
|
||||
CHAOS_FANATIC("Chaos Fanatic", BOSS),
|
||||
COMMANDER_ZILYANA("Commander Zilyana", BOSS),
|
||||
CORPOREAL_BEAST("Corporeal Beast", BOSS),
|
||||
CRAZY_ARCHAEOLOGIST("Crazy Archaeologist", BOSS),
|
||||
DAGANNOTH_PRIME("Dagannoth Prime", BOSS),
|
||||
DAGANNOTH_REX("Dagannoth Rex", BOSS),
|
||||
DAGANNOTH_SUPREME("Dagannoth Supreme", BOSS),
|
||||
DERANGED_ARCHAEOLOGIST("Deranged Archaeologist", BOSS),
|
||||
GENERAL_GRAARDOR("General Graardor", BOSS),
|
||||
GIANT_MOLE("Giant Mole", BOSS),
|
||||
GROTESQUE_GUARDIANS("Grotesque Guardians", BOSS),
|
||||
HESPORI("Hespori", BOSS),
|
||||
KALPHITE_QUEEN("Kalphite Queen", BOSS),
|
||||
KING_BLACK_DRAGON("King Black Dragon", BOSS),
|
||||
KRAKEN("Kraken", BOSS),
|
||||
KREEARRA("Kree'Arra", BOSS),
|
||||
KRIL_TSUTSAROTH("K'ril Tsutsaroth", BOSS),
|
||||
MIMIC("Mimic", BOSS),
|
||||
NEX("Nex", BOSS),
|
||||
NIGHTMARE("Nightmare", BOSS),
|
||||
PHOSANIS_NIGHTMARE("Phosani's Nightmare", BOSS),
|
||||
OBOR("Obor", BOSS),
|
||||
SARACHNIS("Sarachnis", BOSS),
|
||||
SCORPIA("Scorpia", BOSS),
|
||||
SKOTIZO("Skotizo", BOSS),
|
||||
TEMPOROSS("Tempoross", BOSS),
|
||||
THE_GAUNTLET("The Gauntlet", BOSS),
|
||||
THE_CORRUPTED_GAUNTLET("The Corrupted Gauntlet", BOSS),
|
||||
THEATRE_OF_BLOOD("Theatre of Blood", BOSS),
|
||||
THEATRE_OF_BLOOD_HARD_MODE("Theatre of Blood: Hard Mode", BOSS),
|
||||
THERMONUCLEAR_SMOKE_DEVIL("Thermonuclear Smoke Devil", BOSS),
|
||||
TZKAL_ZUK("TzKal-Zuk", BOSS),
|
||||
TZTOK_JAD("TzTok-Jad", BOSS),
|
||||
VENENATIS("Venenatis", BOSS),
|
||||
VETION("Vet'ion", BOSS),
|
||||
VORKATH("Vorkath", BOSS),
|
||||
WINTERTODT("Wintertodt", BOSS),
|
||||
ZALCANO("Zalcano", BOSS),
|
||||
ZULRAH("Zulrah", BOSS);
|
||||
|
||||
private final String name;
|
||||
private final HiscoreSkillType type;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Bram91 <https://github.com/bram91>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.http.api.hiscore;
|
||||
|
||||
public enum HiscoreSkillType
|
||||
{
|
||||
OVERALL,
|
||||
SKILL,
|
||||
ACTIVITY,
|
||||
BOSS
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017. l2-
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.http.api.hiscore;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class SingleHiscoreSkillResult
|
||||
{
|
||||
private String player;
|
||||
private String skillName;
|
||||
private Skill skill;
|
||||
|
||||
public String getPlayer()
|
||||
{
|
||||
return player;
|
||||
}
|
||||
|
||||
public void setPlayer(String player)
|
||||
{
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public String getSkillName()
|
||||
{
|
||||
return skillName;
|
||||
}
|
||||
|
||||
public void setSkillName(String skillName)
|
||||
{
|
||||
this.skillName = skillName;
|
||||
}
|
||||
|
||||
public Skill getSkill()
|
||||
{
|
||||
return skill;
|
||||
}
|
||||
|
||||
public void setSkill(Skill skill)
|
||||
{
|
||||
this.skill = skill;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = 7;
|
||||
hash = 37 * hash + Objects.hashCode(this.player);
|
||||
hash = 37 * hash + Objects.hashCode(this.skillName);
|
||||
hash = 37 * hash + Objects.hashCode(this.skill);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
final SingleHiscoreSkillResult other = (SingleHiscoreSkillResult) obj;
|
||||
if (!Objects.equals(this.player, other.player))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.skillName, other.skillName))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.skill, other.skill))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "SingleHiscoreSkillResult{" + "player=" + player + ", skillName=" + skillName + ", skill=" + skill + '}';
|
||||
}
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Adam <Adam@sigterm.info>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.http.api.hiscore;
|
||||
|
||||
public class Skill
|
||||
{
|
||||
private final int rank;
|
||||
private final int level;
|
||||
private final long experience;
|
||||
|
||||
public Skill(int rank, int level, long experience)
|
||||
{
|
||||
this.rank = rank;
|
||||
this.level = level;
|
||||
this.experience = experience;
|
||||
}
|
||||
|
||||
public int getRank()
|
||||
{
|
||||
return rank;
|
||||
}
|
||||
|
||||
public int getLevel()
|
||||
{
|
||||
return level;
|
||||
}
|
||||
|
||||
public long getExperience()
|
||||
{
|
||||
return experience;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = 3;
|
||||
hash = 59 * hash + this.rank;
|
||||
hash = 59 * hash + this.level;
|
||||
hash = 59 * hash + (int) (this.experience ^ (this.experience >>> 32));
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
final Skill other = (Skill) obj;
|
||||
if (this.rank != other.rank)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (this.level != other.level)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (this.experience != other.experience)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Skill{" + "rank=" + rank + ", level=" + level + ", experience=" + experience + '}';
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Adam <Adam@sigterm.info>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.http.api.xp;
|
||||
|
||||
import java.time.Instant;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(exclude = "time")
|
||||
public class XpData
|
||||
{
|
||||
private Instant time;
|
||||
|
||||
private int attack_xp;
|
||||
private int defence_xp;
|
||||
private int strength_xp;
|
||||
private int hitpoints_xp;
|
||||
private int ranged_xp;
|
||||
private int prayer_xp;
|
||||
private int magic_xp;
|
||||
private int cooking_xp;
|
||||
private int woodcutting_xp;
|
||||
private int fletching_xp;
|
||||
private int fishing_xp;
|
||||
private int firemaking_xp;
|
||||
private int crafting_xp;
|
||||
private int smithing_xp;
|
||||
private int mining_xp;
|
||||
private int herblore_xp;
|
||||
private int agility_xp;
|
||||
private int thieving_xp;
|
||||
private int slayer_xp;
|
||||
private int farming_xp;
|
||||
private int runecraft_xp;
|
||||
private int hunter_xp;
|
||||
private int construction_xp;
|
||||
|
||||
private int overall_rank;
|
||||
private int attack_rank;
|
||||
private int defence_rank;
|
||||
private int strength_rank;
|
||||
private int hitpoints_rank;
|
||||
private int ranged_rank;
|
||||
private int prayer_rank;
|
||||
private int magic_rank;
|
||||
private int cooking_rank;
|
||||
private int woodcutting_rank;
|
||||
private int fletching_rank;
|
||||
private int fishing_rank;
|
||||
private int firemaking_rank;
|
||||
private int crafting_rank;
|
||||
private int smithing_rank;
|
||||
private int mining_rank;
|
||||
private int herblore_rank;
|
||||
private int agility_rank;
|
||||
private int thieving_rank;
|
||||
private int slayer_rank;
|
||||
private int farming_rank;
|
||||
private int runecraft_rank;
|
||||
private int hunter_rank;
|
||||
private int construction_rank;
|
||||
}
|
||||
Reference in New Issue
Block a user