project: Mixing stuff and what not
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user