project: Mixing stuff and what not

This commit is contained in:
Owain van Brakel
2021-10-27 02:23:44 +02:00
parent c7ae30f788
commit 24d7c9c351
23 changed files with 545 additions and 181 deletions

View File

@@ -0,0 +1,70 @@
import java.util.Iterator;
import java.util.NoSuchElementException;
public class RuneLiteIterableHashTable implements Iterator
{
public Node node;
public final NodeHashTable nodeHashTable;
public int it;
public RuneLiteIterableHashTable(NodeHashTable nodeHashTable)
{
this.nodeHashTable = nodeHashTable;
}
@Override
public boolean hasNext()
{
if (this.it > 0 && this.nodeHashTable.buckets[this.it - 1] != this.node)
{
return true;
}
else
{
for (int i = this.it; i < this.nodeHashTable.size; ++i)
{
Node bucket = this.nodeHashTable.buckets[i];
Node previous = bucket.previous;
if (bucket != previous)
{
return true;
}
}
return false;
}
}
@Override
public Node next()
{
if (this.it > 0 && this.nodeHashTable.buckets[this.it - 1] != this.node)
{
Node node = this.node;
this.node = node.previous;
return node;
}
else
{
Node node;
Node previous;
do
{
if (this.it >= this.nodeHashTable.size)
{
throw new NoSuchElementException();
}
node = this.nodeHashTable.buckets[this.it++];
previous = node.previous;
} while (node == previous);
this.node = previous.previous;
return previous;
}
}
}

View File

@@ -7,6 +7,10 @@ public class RuneLiteObject extends GraphicsObject
super.isFinished = true;
}
public boolean isLooping() {
return loop;
}
public boolean isActive() {
return !super.isFinished;
}
@@ -35,33 +39,6 @@ public class RuneLiteObject extends GraphicsObject
this.loop = var1;
}
@Override
public void advance(int var1)
{
if (super.sequenceDefinition != null) {
super.advance(var1);
if (this.loop && super.isFinished) {
super.isFinished = false;
super.frame = 0;
super.frameCycle = 0;
}
}
}
@Override
public Model getModel()
{
if (super.sequenceDefinition != null)
{
return super.sequenceDefinition.transformSpotAnimationModel(this.model, super.frame);
}
else
{
return this.model.toSharedSequenceModel(true);
}
}
public void setModel(Model var1) {
this.model = var1;
}