From fa4755773c8a03fea818c267860cf33e5f84de32 Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Thu, 16 Jan 2020 15:04:24 +0100 Subject: [PATCH] api: Remove equipment item query --- .../api/queries/EquipmentItemQuery.java | 99 ------------------- 1 file changed, 99 deletions(-) delete mode 100644 runelite-api/src/main/java/net/runelite/api/queries/EquipmentItemQuery.java diff --git a/runelite-api/src/main/java/net/runelite/api/queries/EquipmentItemQuery.java b/runelite-api/src/main/java/net/runelite/api/queries/EquipmentItemQuery.java deleted file mode 100644 index c600ca5060..0000000000 --- a/runelite-api/src/main/java/net/runelite/api/queries/EquipmentItemQuery.java +++ /dev/null @@ -1,99 +0,0 @@ -///* -// * Copyright (c) 2017, Devin French -// * 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.api.queries; -// -//import java.awt.Rectangle; -//import java.util.ArrayList; -//import java.util.Arrays; -//import java.util.Collection; -//import java.util.Objects; -//import java.util.stream.Collectors; -//import net.runelite.api.Client; -//import net.runelite.api.QueryResults; -//import net.runelite.api.widgets.Widget; -//import net.runelite.api.widgets.WidgetInfo; -//import net.runelite.api.widgets.WidgetItem; -// -//public class EquipmentItemQuery extends WidgetItemQuery -//{ -// private static final WidgetInfo[] ALL_EQUIPMENT_WIDGET_INFOS = -// { -// WidgetInfo.EQUIPMENT_HELMET, -// WidgetInfo.EQUIPMENT_CAPE, -// WidgetInfo.EQUIPMENT_AMULET, -// WidgetInfo.EQUIPMENT_WEAPON, -// WidgetInfo.EQUIPMENT_BODY, -// WidgetInfo.EQUIPMENT_SHIELD, -// WidgetInfo.EQUIPMENT_LEGS, -// WidgetInfo.EQUIPMENT_GLOVES, -// WidgetInfo.EQUIPMENT_BOOTS, -// WidgetInfo.EQUIPMENT_RING, -// WidgetInfo.EQUIPMENT_AMMO, -// }; -// -// private final Collection slots = new ArrayList<>(); -// -// public EquipmentItemQuery slotEquals(WidgetInfo... slotWidgetInfo) -// { -// slots.addAll(Arrays.asList(slotWidgetInfo)); -// return this; -// } -// -// @Override -// public QueryResults result(Client client) -// { -// Collection widgetItems = getEquippedItems(client); -// return new QueryResults<>(widgetItems.stream() -// .filter(Objects::nonNull) -// .filter(predicate) -// .collect(Collectors.toList())); -// } -// -// private Collection getEquippedItems(Client client) -// { -// Collection widgetItems = new ArrayList<>(); -// Widget equipment = client.getWidget(WidgetInfo.EQUIPMENT); -// if (equipment != null && !equipment.isHidden()) -// { -// if (slots.isEmpty()) -// { -// slots.addAll(Arrays.asList(ALL_EQUIPMENT_WIDGET_INFOS)); -// } -// for (WidgetInfo slot : slots) -// { -// Widget parentWidget = client.getWidget(slot); -// Widget itemWidget = parentWidget.getChild(1); -// // Check if background icon is hidden. if hidden, item is equipped. -// boolean equipped = parentWidget.getChild(2).isSelfHidden(); -// // set bounds to same size as default inventory -// Rectangle bounds = itemWidget.getBounds(); -// bounds.setBounds(bounds.x - 1, bounds.y - 1, 32, 32); -// // Index is set to 0 because there is no set in stone order of equipment slots -// widgetItems.add(new WidgetItem(equipped ? itemWidget.getItemId() : -1, itemWidget.getItemQuantity(), 0, bounds, itemWidget)); -// } -// } -// return widgetItems; -// } -//}