Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.prime.api.game.hybrid.location;
- import com.runemate.game.api.hybrid.Environment;
- import com.runemate.game.api.hybrid.entities.details.Locatable;
- import com.runemate.game.api.hybrid.location.Area;
- import com.runemate.game.api.hybrid.location.Coordinate;
- import com.runemate.game.api.hybrid.region.Players;
- import com.runemate.game.api.hybrid.util.calculations.Distance;
- /**
- * BankLocation
- *
- * @author Torben Schmitz
- */
- public enum BankLocation implements Locatable {
- NONE("None", Type.NONE, null, null),
- AL_KHARID("Al Kharid", Type.FULL, new Coordinate(3270, 3168, 0), new Coordinate(3270, 3167, 0)),
- APE_ATOLL_SOUTH("Ape Atoll", Type.DEPOSIT, new Coordinate(3047, 3237, 0), new Coordinate(3047, 3237, 0)),
- ARDOUGNE_EAST("Ardougne East", Type.FULL, new Coordinate(2655, 3283, 0), new Coordinate(2655, 3283, 0)),
- BARBARIAN_OUTPOST("Barbarian outpost", Type.FULL, new Coordinate(2536, 3572, 0), new Coordinate(2536, 3572, 0)),
- BURGH_DE_ROTT("Burgh de Rott", Type.FULL, new Coordinate(3495, 3211, 0), new Coordinate(3495, 3211, 0)),
- BURTHORPE("Burthorpe", Type.FULL, new Coordinate(2888, 3536, 0), null),
- CATHERBY("Catherby", Type.FULL, new Coordinate(2795, 3440, 0), new Coordinate(2809, 3440, 0)),
- CASTLE_WARS("Castle Wars", Type.FULL, new Coordinate(2446, 3085, 0), new Coordinate(2442, 3085, 0)),
- CLAN_CAMP_FALADOR("Clan camp Falador", Type.FULL, new Coordinate(2956, 3297, 0), null),
- DRAYNOR_VILLAGE("Draynor Village", Type.FULL, new Coordinate(3092, 3244, 0), new Coordinate(3092, 3244, 0)),
- DUEL_ARENA("Duel Arena", Type.FULL, new Coordinate(3349, 3238, 0), new Coordinate(3349, 3238, 0)),
- EDGEVILLE("Edgeville", Type.FULL, new Coordinate(3094, 3493, 0), new Coordinate(3094, 3493, 0)),
- FALADOR_EAST("Falador East", Type.FULL, new Coordinate(3012, 3355, 0), new Coordinate(3012, 3355, 0)),
- FALADOR_WEST("Falador West", Type.FULL, new Coordinate(2946, 3368, 0), new Coordinate(2946, 3368, 0)),
- FISHING_GUILD("Fishing Guild", Type.FULL, new Coordinate(2585, 3422, 0), new Coordinate(2587, 3419, 0)),
- GRAND_EXCHANGE("Grand Exchange", Type.FULL, new Coordinate(3151, 3480, 0), new Coordinate(3151, 3480, 0)),
- HOSIDIUS_EAST("Hosidius East", Type.FULL, null, new Coordinate(1807, 3571, 0) ),
- HOSIDIUS_SOUTH("Hosidius South", Type.FULL, null, new Coordinate(1719, 3465, 0) ),
- KARAMJA("Stiles", Type.SPECIAL, new Coordinate(2851, 3143, 0), new Coordinate(3045, 3234, 0)),
- LANDS_END("Land's end", Type.FULL, null, new Coordinate(1512, 3421, 0)),
- LIVING_ROCK_CAVERNS("Living Rock Caverns", Type.SPECIAL, new Coordinate(3654, 5114, 0), null),
- LUMBRIDGE_CASTLE("Lumbridge Castle", Type.FULL, new Coordinate(3208, 3220, 2), new Coordinate(3208, 3220, 2)),
- LUMBRIDGE_COMBAT_ACADEMY("Lumbridge Combat Academy", Type.FULL, new Coordinate(3215, 3257, 0), null),
- MENAPHOS_PORT_DISTRICT("Menaphos - Port district", Type.DEPOSIT, new Coordinate(3217, 2622, 0), null),
- MENAPHOS_MERCHANT_DISTRICT("Menaphos - Merchant district", Type.FULL, new Coordinate(3236, 2759, 0), null),
- MOR_UL_REK("Mor Ul Rek", Type.FULL, null, new Coordinate(2542, 5140, 0)),
- PISCARILIUS("Piscarilius (Zeah)", Type.FULL, null, new Coordinate(1804, 3790, 0)),
- PISCATORIS("Piscatoris", Type.FULL, new Coordinate(2330, 3690, 0), new Coordinate(2330, 3690, 0)),
- PORT_PHASMATYS("Port Phasmatys", Type.FULL, null, new Coordinate(3690, 3466, 0)),
- PORT_SARIM("Port Sarim", Type.DEPOSIT, new Coordinate(3045, 3234, 0), new Coordinate(3045, 3234, 0)),
- PRIFDDINAS_WATERFALL("Prifddinas Waterfall", Type.FULL, new Coordinate(2293, 3404, 2), null),
- SEERS_VILLAGE("Seer's Village", Type.FULL, new Coordinate(2727, 3494, 0), new Coordinate(2725, 3492, 0)),
- SHILO_VILLAGE("Shilo Village", Type.FULL, new Coordinate(2853, 2955, 0), new Coordinate(2853, 2955, 0)),
- VARROCK_EAST("Varrock East", Type.FULL, null, new Coordinate(3253, 3420, 0)),
- VARROCK_WEST("Varrock West", Type.FULL, new Coordinate(3190, 3435, 0), new Coordinate(3183, 3439, 0)),
- WAIKO("Waiko (The Arc)", Type.FULL, new Coordinate(1831, 11613, 0), null),
- WHALES_MAW("Whale's Maw (The Arc)", Type.DEPOSIT, new Coordinate(2058, 11781, 0), null),
- WOODCUTTING_GUILD("Woodcutting Guild", Type.FULL, new Coordinate(1592, 3476, 0), new Coordinate(1592, 3476, 0)),
- YANILLE("Yanille", Type.FULL, new Coordinate(2612, 3093, 0), new Coordinate(2612, 3093, 0)),
- ZUL_ANDRA("Zul-Andra", Type.DEPOSIT, null, new Coordinate(2196, 3052, 0));
- private final String name;
- private final Type type;
- private final Coordinate rs3Coordinate, osrsCoordinate;
- BankLocation(String name, Type type, Coordinate rs3Coordinate, Coordinate osrsCoordinate) {
- this.name = name;
- this.type = type;
- this.rs3Coordinate = rs3Coordinate;
- this.osrsCoordinate = osrsCoordinate;
- }
- public String getName() {
- return name;
- }
- @Override
- public String toString() {
- return name;
- }
- @Override
- public Coordinate getPosition() {
- return Environment.isOSRS() ? osrsCoordinate : rs3Coordinate;
- }
- @Override
- public Area.Rectangular getArea() {
- return new Area.Rectangular(getPosition());
- }
- @Override
- public Coordinate.HighPrecision getHighPrecisionPosition() {
- return getPosition().getHighPrecisionPosition();
- }
- public static BankLocation getNearest() {
- return getNearest(false);
- }
- public static BankLocation getNearest(boolean ignorePlane) {
- double distance = -1;
- BankLocation selected = null;
- Coordinate playerPosition = Players.getLocal().getPosition();
- for (BankLocation bankLocation : BankLocation.values()) {
- Coordinate bankPosition = bankLocation.getPosition();
- if (bankPosition != null) {
- if (bankPosition.getPlane() != playerPosition.getPlane()) {
- if (ignorePlane) {
- bankPosition = new Coordinate(bankPosition.getX(), bankPosition.getY(), playerPosition.getPlane());
- } else {
- continue;
- }
- }
- double to = Distance.between(playerPosition, bankPosition);
- if (distance == -1 || to < distance) {
- distance = to;
- selected = bankLocation;
- }
- }
- }
- return selected;
- }
- public Type getType() {
- return type;
- }
- public enum Type {
- NONE, DEPOSIT, FULL, SPECIAL
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement