project: Injector and mixins

This commit is contained in:
Owain van Brakel
2021-12-15 05:39:57 +01:00
parent 62a5942180
commit 6b133497df
30 changed files with 530 additions and 168 deletions

View File

@@ -0,0 +1,49 @@
import java.util.Iterator;
import java.util.NoSuchElementException;
public class RuneLiteIterableLinkDeque implements Iterator<Link>
{
public final LinkDeque linkDeque;
public Link link;
public RuneLiteIterableLinkDeque(LinkDeque linkDeque)
{
this.linkDeque = linkDeque;
this.link = this.linkDeque.sentinel.previous;
}
@Override
public boolean hasNext()
{
return this.link != this.linkDeque.sentinel;
}
@Override
public Link next()
{
if (this.link == this.linkDeque.sentinel)
{
throw new NoSuchElementException();
}
else
{
Link friendLoginUpdate = this.link;
this.link = this.link.previous;
return friendLoginUpdate;
}
}
public void remove()
{
Link link = this.link.next;
if (link == this.linkDeque.sentinel)
{
throw new IllegalStateException();
}
else
{
link.remove();
}
}
}