Package rsb.util
Class SkillTracker
java.lang.Object
rsb.util.SkillTracker
Deprecated.
A class for tracking experience gains in specified skills.
The three arrays (skills, startExp, currentExp) are constantly congruent, and
updated as such.
- Author:
- GigiaJ
-
Field Summary
FieldsModifier and TypeFieldDescriptionint[]
Deprecated.int
Deprecated.int
Deprecated.int[]
Deprecated.long
Deprecated.boolean
Deprecated.int[]
Deprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(int skill) Deprecated.Adds a skill into the skills array and updates it.boolean
arrayContains
(int index, int[] array) Deprecated.Determines if an array contains the specified index.int
getArrayIndex
(int secondaryIndex, int[] array) Deprecated.Determines the true index for an item within the specified array.int[]
getGains()
Deprecated.Calculates the true gains of the skills being tracked.int[]
Deprecated.Calculates the experience gained per hour.getName
(int skill) Deprecated.Retrieves the name of the indicated skill.long
Deprecated.Calculates the current runtime.int[]
Deprecated.Calculates number of seconds until level gainvoid
growAtEnd
(int growth) Deprecated.Expands the current array (skillsList) by the specified growth.boolean
Deprecated.Determines if the current SkillTracker is started.void
remove
(int index) Deprecated.Removes an item using index (of item in array).boolean
removeSkill
(int index) Deprecated.Removes an item from the current array.static String
SecToHMS
(int sec) Deprecated.Converts a number of seconds into a string of form hh:mm:ssvoid
start()
Deprecated.Updates all the skills within the current array and starts the time at the currentTimeMillis.int[]
toArray()
Deprecated.Returns the main value of the skills array.void
update
(int index) Deprecated.Updates a single skill dependent on the index of the skill.void
Deprecated.Updates all skills within the skills array.
-
Field Details
-
skills
public int[] skillsDeprecated. -
startExp
public int[] startExpDeprecated. -
currentExp
public int[] currentExpDeprecated. -
firstIndex
public transient int firstIndexDeprecated. -
lastIndex
public transient int lastIndexDeprecated. -
start
public long startDeprecated. -
started
public boolean startedDeprecated.
-
-
Constructor Details
-
SkillTracker
Deprecated.
-
-
Method Details
-
start
public void start()Deprecated.Updates all the skills within the current array and starts the time at the currentTimeMillis. -
isStarted
public boolean isStarted()Deprecated.Determines if the current SkillTracker is started.- Returns:
true
if the tracker is started; otherwisefalse
-
getRuntime
public long getRuntime()Deprecated.Calculates the current runtime.- Returns:
- the runtime of the tracker
-
updateAll
public void updateAll()Deprecated.Updates all skills within the skills array. -
update
public void update(int index) Deprecated.Updates a single skill dependent on the index of the skill.- Parameters:
index
- the index of the skill to update
-
remove
public void remove(int index) Deprecated.Removes an item using index (of item in array). Recommended to use removeItem to remove via skill index.- Parameters:
index
- the skill to remove from the array
-
removeSkill
public boolean removeSkill(int index) Deprecated.Removes an item from the current array.- Parameters:
index
- Of the skill to remove.- Returns:
true
If removed.
-
add
public void add(int skill) Deprecated.Adds a skill into the skills array and updates it. Start experience will be calculated during the the exact time the item is added into the array.- Parameters:
skill
- The skill to add.
-
arrayContains
public boolean arrayContains(int index, int[] array) Deprecated.Determines if an array contains the specified index.- Parameters:
index
- the index to checkarray
- the array to check- Returns:
true
if the array contains the index; otherwisefalse
-
getArrayIndex
public int getArrayIndex(int secondaryIndex, int[] array) Deprecated.Determines the true index for an item within the specified array.- Parameters:
secondaryIndex
- the inner index in the array to checkarray
- the array to check- Returns:
- the true index
-
growAtEnd
public void growAtEnd(int growth) Deprecated.Expands the current array (skillsList) by the specified growth.- Parameters:
growth
- the integer amount to increase the array size by
-
toArray
public int[] toArray()Deprecated.Returns the main value of the skills array.- Returns:
- the skills array
-
getGains
public int[] getGains()Deprecated.Calculates the true gains of the skills being tracked. (Updates current experience)- Returns:
- an array containing the calculated gains of the skills tracked
-
getHourlyGains
public int[] getHourlyGains()Deprecated.Calculates the experience gained per hour. (Updates current experience)- Returns:
- the calculated hourly gains
-
getName
Deprecated.Retrieves the name of the indicated skill.- Parameters:
skill
- the index to check for- Returns:
- the name of the skill at a specified index
-
getSecTNL
public int[] getSecTNL()Deprecated.Calculates number of seconds until level gain- Returns:
- the calculated value estimate for gaining a level
-
SecToHMS
Deprecated.Converts a number of seconds into a string of form hh:mm:ss- Parameters:
sec
- the seconds to convert into the HMS format- Returns:
- the hour minutes and seconds representation of the parameter
-