OGS Java API Spec

ogs.core
Class Experience

java.lang.Object
  |
  +--ogs.core.Experience

public class Experience
extends Object

A utility class for calculating experience points, levels, and other attributes that depend on experience. Experience points and experience levels are represented as integer values but never have negative values.


Method Summary
static String formatLevel(int level)
          Format a string for a given experience level.
static int getAverageAttack(int xpLevel)
          Calculate the base attack bonus at a given experience level.
static int getLevel(int xpPoints)
          Calculate the level equivalent to a given number of points.
static int getPoints(int xpLevel)
          Calculate the points required for a given level.
static int getStrongAttack(int xpLevel)
          Calculate the base attack bonus at a given experience level.
static int getWeakAttack(int xpLevel)
          Calculate the base attack bonus at a given experience level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLevel

public static int getLevel(int xpPoints)
Calculate the level equivalent to a given number of points.

Parameters:
xpPoints - Number of experience points.
Returns:
Equivalent experience level.

getPoints

public static int getPoints(int xpLevel)
Calculate the points required for a given level. Subclasses can override this method to generate a different rate of advancement.

Parameters:
xpLevel - An experience level.
Returns:
Required number of experience points.

getWeakAttack

public static int getWeakAttack(int xpLevel)
Calculate the base attack bonus at a given experience level. The base attack bonus is calculated using the weak (slow) advancement rate for base attack bonuses.

Returns:
Value of base attack bonus.

getAverageAttack

public static int getAverageAttack(int xpLevel)
Calculate the base attack bonus at a given experience level. The base attack bonus is calculated using the average advancement rate for base attack bonuses.

Returns:
Value of base attack bonus.

getStrongAttack

public static int getStrongAttack(int xpLevel)
Calculate the base attack bonus at a given experience level. The base attack bonus is calculated using the strong (fastest) advancement rate for base attack bonuses.

Returns:
Value of base attack bonus.

formatLevel

public static String formatLevel(int level)
Format a string for a given experience level.

Returns:
"1st", "2nd", "3rd", "4th", etc.

OGS Java API Spec