use of org.powerbot.bot.rt6.client.LinkedListNode in project powerbot by powerbot.
the class Actor method getBarData.
private CombatStatusData[] getBarData() {
final LinkedListNode[] nodes = getBarNodes();
final Client client = ctx.client();
if (nodes == null || client == null) {
return null;
}
final CombatStatusData[] data = new CombatStatusData[nodes.length];
for (int i = 0; i < nodes.length; i++) {
if (nodes[i] == null || nodes[i].isNull() || !nodes[i].isTypeOf(CombatStatus.class)) {
data[i] = null;
continue;
}
final CombatStatus status = new CombatStatus(nodes[i].reflector, nodes[i]);
final org.powerbot.bot.rt6.client.LinkedList statuses;
try {
statuses = status.getList();
} catch (final IllegalArgumentException ignored) {
continue;
}
if (statuses == null) {
data[i] = null;
continue;
}
final LinkedListNode node = statuses.getSentinel().getNext();
if (node.isNull() || !node.isTypeOf(CombatStatusData.class)) {
data[i] = null;
continue;
}
data[i] = new CombatStatusData(node.reflector, node);
}
return data;
}
use of org.powerbot.bot.rt6.client.LinkedListNode in project powerbot by powerbot.
the class Actor method getBarNodes.
private LinkedListNode[] getBarNodes() {
final org.powerbot.bot.rt6.client.Actor accessor = getAccessor();
if (accessor == null) {
return null;
}
final org.powerbot.bot.rt6.client.LinkedList barList = accessor.getCombatStatusList();
if (barList == null) {
return null;
}
final LinkedListNode tail = barList.getSentinel();
final LinkedListNode health;
final LinkedListNode adrenaline;
final LinkedListNode current;
current = tail.getNext();
if (!current.getNext().equals(tail)) {
adrenaline = current;
health = current.getNext();
} else {
adrenaline = null;
health = current;
}
return new LinkedListNode[] { adrenaline, health };
}
Aggregations