runelite-api: make HashTable a generic
This commit is contained in:
@@ -692,7 +692,7 @@ public interface Client extends GameEngine
|
||||
* @return the widget node component table
|
||||
* @see WidgetNode
|
||||
*/
|
||||
HashTable getComponentTable();
|
||||
HashTable<WidgetNode> getComponentTable();
|
||||
|
||||
/**
|
||||
* Gets an array of current grand exchange offers.
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.util.Collection;
|
||||
* A data structure that uses a hash function to compute an index into an
|
||||
* array of buckets from which node objects can be quickly obtained.
|
||||
*/
|
||||
public interface HashTable
|
||||
public interface HashTable<T extends Node>
|
||||
{
|
||||
/**
|
||||
* Gets a node by its hash value.
|
||||
@@ -38,12 +38,12 @@ public interface HashTable
|
||||
* @param value the node value
|
||||
* @return the associated node
|
||||
*/
|
||||
Node get(long value);
|
||||
T get(long value);
|
||||
|
||||
/**
|
||||
* Gets a collection of all nodes stored in this table.
|
||||
*
|
||||
* @return the nodes stored
|
||||
*/
|
||||
Collection<Node> getNodes();
|
||||
Collection<T> getNodes();
|
||||
}
|
||||
|
||||
@@ -339,10 +339,9 @@ public class ReorderPrayersPlugin extends Plugin
|
||||
|
||||
private PrayerTabState getPrayerTabState()
|
||||
{
|
||||
HashTable componentTable = client.getComponentTable();
|
||||
for (Node node : componentTable.getNodes())
|
||||
HashTable<WidgetNode> componentTable = client.getComponentTable();
|
||||
for (WidgetNode widgetNode : componentTable.getNodes())
|
||||
{
|
||||
WidgetNode widgetNode = (WidgetNode) node;
|
||||
if (widgetNode.getId() == WidgetID.PRAYER_GROUP_ID)
|
||||
{
|
||||
return PrayerTabState.PRAYERS;
|
||||
|
||||
@@ -30,6 +30,7 @@ import net.runelite.mapping.Import;
|
||||
public interface RSHashTable extends HashTable
|
||||
{
|
||||
@Import("get")
|
||||
@Override
|
||||
RSNode get(long value);
|
||||
|
||||
@Import("size")
|
||||
|
||||
Reference in New Issue
Block a user