Update to include FPS, without changing formatting of anything. (#5)

This commit is contained in:
Cameron Moberg
2017-02-01 19:50:09 -06:00
committed by Adam
parent 971a99b241
commit 5d8396cf59
10 changed files with 234 additions and 13 deletions

View File

@@ -25,6 +25,7 @@
package net.runelite.api;
import java.awt.*;
import java.util.Arrays;
public class Client
@@ -40,22 +41,22 @@ public class Client
{
if (client.getLocalPlayer() == null)
return null;
return new Player(this, client.getLocalPlayer());
}
public NPC[] getNpcs()
{
return Arrays.stream(client.getCachedNPCs())
.map(npc -> npc != null ? new NPC(this, npc) : null)
.toArray(size -> new NPC[size]);
.map(npc -> npc != null ? new NPC(this, npc) : null)
.toArray(size -> new NPC[size]);
}
public Player[] getPlayers()
{
return Arrays.stream(client.getCachedPlayers())
.map(player -> player != null ? new Player(this, player) : null)
.toArray(size -> new Player[size]);
.map(player -> player != null ? new Player(this, player) : null)
.toArray(size -> new Player[size]);
}
public int[] getBoostedSkillLevels()
@@ -82,4 +83,24 @@ public class Client
{
return GameState.of(client.getGameState());
}
public Canvas getCanvas()
{
return client.getCanvas();
}
public int getFPS()
{
return client.getFPS();
}
public int getClientHeight()
{
return client.getCanvas().getHeight();
}
public int getClientWidth()
{
return client.getCanvas().getWidth();
}
}