public class Health
extends java.lang.Object
Constructor and Description |
---|
Health()
Default health constructor
|
Health(int value,
int max)
Health constructor
|
Modifier and Type | Method and Description |
---|---|
int |
getMax()
Returns maximal health value
|
int |
getValue()
Returns current health value
|
void |
modMax(int value)
Modifies maximal health value by specified value
|
void |
modValue(int value)
Modifies current health value by specified value
|
void |
setMax(int value)
Sets specified value as maximal value of health
|
void |
setValue(int value)
Sets specified value as current health value
|
java.lang.String |
toString() |
public Health()
public Health(int value, int max)
value
- Current health valuemax
- Maximal health valuepublic void modValue(int value)
value
- Value to add(negative value to subtract)public void modMax(int value)
value
- Value to add(negative value to subtract)public void setValue(int value)
value
- Value to setpublic void setMax(int value)
value
- Value to setpublic int getValue()
public int getMax()
public java.lang.String toString()
toString
in class java.lang.Object