2021-04-29 14:45:18 +00:00
|
|
|
package uulm.teamname.marvelous.gamelibrary.entities;
|
2021-04-29 14:40:23 +00:00
|
|
|
|
|
|
|
/** Represents a stat property of a {@link Character}.
|
|
|
|
*/
|
|
|
|
public class Stat {
|
|
|
|
/** The {@link StatType} of the stat.
|
|
|
|
*/
|
|
|
|
public final StatType type;
|
|
|
|
|
|
|
|
/** The maximum value of the stat.
|
|
|
|
*/
|
|
|
|
public final int max;
|
|
|
|
|
|
|
|
/** The current value of the stat.
|
|
|
|
*/
|
|
|
|
private int value;
|
|
|
|
|
|
|
|
/** Constructs a new {@link Stat} with the initial value set to the maximum value.
|
|
|
|
* @param type The {@link StatType} of the stat.
|
|
|
|
* @param max The maximum value of the stat.
|
|
|
|
*/
|
|
|
|
public Stat(StatType type, int max) {
|
|
|
|
this.type = type;
|
|
|
|
this.max = max;
|
|
|
|
this.value = max;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getValue() {
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setValue(int value) {
|
|
|
|
this.value = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void increaseValue(int value) {
|
|
|
|
this.value += value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void decreaseValue(int value) {
|
|
|
|
this.value -= value;
|
|
|
|
}
|
|
|
|
}
|