theatre: Use efficient entrySets
This commit is contained in:
@@ -152,11 +152,11 @@ public class NyloHandler extends RoomHandler
|
||||
{
|
||||
if (plugin.isShowNyloPillarHealth())
|
||||
{
|
||||
for (NPC npc : pillars.keySet())
|
||||
for (Map.Entry<NPC, Integer> pillars : pillars.entrySet())
|
||||
{
|
||||
final int health = pillars.get(npc);
|
||||
final int health = pillars.getValue();
|
||||
final String healthStr = health + "%";
|
||||
WorldPoint p = npc.getWorldLocation();
|
||||
WorldPoint p = pillars.getKey().getWorldLocation();
|
||||
LocalPoint lp = LocalPoint.fromWorld(client, p.getX() + 1, p.getY() + 1);
|
||||
|
||||
Color c = this.healthColorCode(health);
|
||||
@@ -172,15 +172,15 @@ public class NyloHandler extends RoomHandler
|
||||
switch (plugin.getShowNylocasExplosions())
|
||||
{
|
||||
case TILE:
|
||||
for (NPC npc : spiders.keySet())
|
||||
for (Map.Entry<NPC, Integer> spiders : spiders.entrySet())
|
||||
{
|
||||
int ticksLeft = spiders.get(npc);
|
||||
int ticksLeft = spiders.getValue();
|
||||
if (ticksLeft > -1 && ticksLeft < 6)
|
||||
{
|
||||
Color color = new Color(255, 255, 0, 180);
|
||||
int outlineWidth = 2;
|
||||
int outlineAlpha = 150;
|
||||
renderNpcOverlay(graphics, npc, color, outlineWidth, outlineAlpha, 15);
|
||||
renderNpcOverlay(graphics, spiders.getKey(), color, outlineWidth, outlineAlpha, 15);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -152,18 +152,18 @@ public class NyloPredictor
|
||||
handler.setWave(currentIndex);
|
||||
System.out.println("Nylocas Wave #" + currentIndex + " has spawned @ " + (this.client.getTickCount() - this.handler.startTick) + " | " + npcs.size() + " size.");
|
||||
|
||||
for (NPC npc : npcs.keySet())
|
||||
for (Map.Entry<NPC, Nylocas> nylocas : npcs.entrySet())
|
||||
{
|
||||
Nylocas nylo = npcs.get(npc);
|
||||
Nylocas nylo = nylocas.getValue();
|
||||
|
||||
if (!this.handler.waveSpawns.contains(npc))
|
||||
if (!this.handler.waveSpawns.contains(nylocas.getKey()))
|
||||
{
|
||||
this.handler.waveSpawns.add(npc);
|
||||
this.handler.waveSpawns.add(nylocas.getKey());
|
||||
}
|
||||
|
||||
if (this.isAgressive(nylo.getType(), nylo.getSpawn(), currentIndex) && !this.handler.waveAgros.contains(npc))
|
||||
if (this.isAgressive(nylo.getType(), nylo.getSpawn(), currentIndex) && !this.handler.waveAgros.contains(nylocas.getKey()))
|
||||
{
|
||||
this.handler.waveAgros.add(npc);
|
||||
this.handler.waveAgros.add(nylocas.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -134,9 +134,9 @@ public class XarpusHandler extends RoomHandler
|
||||
|
||||
if (npc.getId() == NpcID.XARPUS_8339 && plugin.isShowXarpusHeals())
|
||||
{
|
||||
for (GroundObject o : exhumes.keySet())
|
||||
for (Map.Entry<GroundObject, Integer> exhum : exhumes.entrySet())
|
||||
{
|
||||
Polygon poly = o.getCanvasTilePoly();
|
||||
Polygon poly = exhum.getKey().getCanvasTilePoly();
|
||||
if (poly != null)
|
||||
{
|
||||
Color c = new Color(0, 255, 0, 130);
|
||||
@@ -144,8 +144,8 @@ public class XarpusHandler extends RoomHandler
|
||||
graphics.setStroke(new BasicStroke(1));
|
||||
graphics.draw(poly);
|
||||
|
||||
String count = Integer.toString(exhumes.get(o) + 1);
|
||||
LocalPoint lp = o.getLocalLocation();
|
||||
String count = Integer.toString(exhum.getValue() + 1);
|
||||
LocalPoint lp = exhum.getKey().getLocalLocation();
|
||||
Point point = Perspective.getCanvasTextLocation(client, graphics, lp, count, 0);
|
||||
if (point != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user