184 lines
3.9 KiB
Java
184 lines
3.9 KiB
Java
import net.runelite.mapping.Export;
|
|
import net.runelite.mapping.Implements;
|
|
import net.runelite.mapping.ObfuscatedName;
|
|
import net.runelite.mapping.ObfuscatedSignature;
|
|
|
|
@ObfuscatedName("je")
|
|
@Implements("NodeDeque")
|
|
public class NodeDeque {
|
|
@ObfuscatedName("m")
|
|
@ObfuscatedSignature(
|
|
signature = "Lgw;"
|
|
)
|
|
@Export("sentinel")
|
|
public Node sentinel;
|
|
@ObfuscatedName("f")
|
|
@ObfuscatedSignature(
|
|
signature = "Lgw;"
|
|
)
|
|
@Export("current")
|
|
Node current;
|
|
|
|
public NodeDeque() {
|
|
this.sentinel = new Node();
|
|
this.sentinel.previous = this.sentinel;
|
|
this.sentinel.next = this.sentinel;
|
|
}
|
|
|
|
@ObfuscatedName("m")
|
|
@Export("clear")
|
|
public void clear() {
|
|
while (true) {
|
|
Node var1 = this.sentinel.previous;
|
|
if (var1 == this.sentinel) {
|
|
this.current = null;
|
|
return;
|
|
}
|
|
|
|
var1.remove();
|
|
}
|
|
}
|
|
|
|
@ObfuscatedName("f")
|
|
@ObfuscatedSignature(
|
|
signature = "(Lgw;)V"
|
|
)
|
|
@Export("addFirst")
|
|
public void addFirst(Node node) {
|
|
if (node.next != null) {
|
|
node.remove();
|
|
}
|
|
|
|
node.next = this.sentinel.next;
|
|
node.previous = this.sentinel;
|
|
node.next.previous = node;
|
|
node.previous.next = node;
|
|
}
|
|
|
|
@ObfuscatedName("q")
|
|
@ObfuscatedSignature(
|
|
signature = "(Lgw;)V"
|
|
)
|
|
@Export("addLast")
|
|
public void addLast(Node node) {
|
|
if (node.next != null) {
|
|
node.remove();
|
|
}
|
|
|
|
node.next = this.sentinel;
|
|
node.previous = this.sentinel.previous;
|
|
node.next.previous = node;
|
|
node.previous.next = node;
|
|
}
|
|
|
|
@ObfuscatedName("o")
|
|
@ObfuscatedSignature(
|
|
signature = "()Lgw;"
|
|
)
|
|
@Export("removeLast")
|
|
public Node removeLast() {
|
|
Node var1 = this.sentinel.previous;
|
|
if (var1 == this.sentinel) {
|
|
return null;
|
|
} else {
|
|
var1.remove();
|
|
return var1;
|
|
}
|
|
}
|
|
|
|
@ObfuscatedName("u")
|
|
@ObfuscatedSignature(
|
|
signature = "()Lgw;"
|
|
)
|
|
@Export("removeFirst")
|
|
public Node removeFirst() {
|
|
Node var1 = this.sentinel.next;
|
|
if (var1 == this.sentinel) {
|
|
return null;
|
|
} else {
|
|
var1.remove();
|
|
return var1;
|
|
}
|
|
}
|
|
|
|
@ObfuscatedName("g")
|
|
@ObfuscatedSignature(
|
|
signature = "()Lgw;"
|
|
)
|
|
@Export("last")
|
|
public Node last() {
|
|
Node var1 = this.sentinel.previous;
|
|
if (var1 == this.sentinel) {
|
|
this.current = null;
|
|
return null;
|
|
} else {
|
|
this.current = var1.previous;
|
|
return var1;
|
|
}
|
|
}
|
|
|
|
@ObfuscatedName("l")
|
|
@ObfuscatedSignature(
|
|
signature = "()Lgw;"
|
|
)
|
|
@Export("first")
|
|
public Node first() {
|
|
Node var1 = this.sentinel.next;
|
|
if (var1 == this.sentinel) {
|
|
this.current = null;
|
|
return null;
|
|
} else {
|
|
this.current = var1.next;
|
|
return var1;
|
|
}
|
|
}
|
|
|
|
@ObfuscatedName("e")
|
|
@ObfuscatedSignature(
|
|
signature = "()Lgw;"
|
|
)
|
|
@Export("previous")
|
|
public Node previous() {
|
|
Node var1 = this.current;
|
|
if (var1 == this.sentinel) {
|
|
this.current = null;
|
|
return null;
|
|
} else {
|
|
this.current = var1.previous;
|
|
return var1;
|
|
}
|
|
}
|
|
|
|
@ObfuscatedName("x")
|
|
@ObfuscatedSignature(
|
|
signature = "()Lgw;"
|
|
)
|
|
@Export("next")
|
|
public Node next() {
|
|
Node var1 = this.current;
|
|
if (var1 == this.sentinel) {
|
|
this.current = null;
|
|
return null;
|
|
} else {
|
|
this.current = var1.next;
|
|
return var1;
|
|
}
|
|
}
|
|
|
|
@ObfuscatedName("w")
|
|
@ObfuscatedSignature(
|
|
signature = "(Lgw;Lgw;)V"
|
|
)
|
|
@Export("NodeDeque_addBefore")
|
|
public static void NodeDeque_addBefore(Node var0, Node var1) {
|
|
if (var0.next != null) {
|
|
var0.remove();
|
|
}
|
|
|
|
var0.next = var1.next;
|
|
var0.previous = var1;
|
|
var0.next.previous = var0;
|
|
var0.previous.next = var0;
|
|
}
|
|
}
|