runelite-api: add total level api
This commit is contained in:
@@ -101,6 +101,13 @@ public interface Client extends GameEngine
|
||||
*/
|
||||
int getRealSkillLevel(Skill skill);
|
||||
|
||||
/**
|
||||
* Calculates the total level from real skill levels.
|
||||
*
|
||||
* @return the total level
|
||||
*/
|
||||
int getTotalLevel();
|
||||
|
||||
/**
|
||||
* Adds a new chat message to the chatbox.
|
||||
*
|
||||
|
||||
@@ -300,6 +300,26 @@ public abstract class RSClientMixin implements RSClient
|
||||
return realLevels[skill.ordinal()];
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public int getTotalLevel()
|
||||
{
|
||||
int totalLevel = 0;
|
||||
|
||||
int[] realLevels = client.getRealSkillLevels();
|
||||
int lastSkillIdx = Skill.CONSTRUCTION.ordinal();
|
||||
|
||||
for (int i = 0; i < realLevels.length; i++)
|
||||
{
|
||||
if (i <= lastSkillIdx)
|
||||
{
|
||||
totalLevel += realLevels[i];
|
||||
}
|
||||
}
|
||||
|
||||
return totalLevel;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void addChatMessage(ChatMessageType type, String name, String message, String sender)
|
||||
|
||||
Reference in New Issue
Block a user