2021-06-02 14:28:19 +00:00
|
|
|
package uulm.teamname.marvelous.gamelibrary.config;
|
2021-05-31 15:50:15 +00:00
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
2021-06-02 14:10:35 +00:00
|
|
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
2021-05-31 15:50:15 +00:00
|
|
|
|
2021-06-02 14:10:35 +00:00
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
@JsonPropertyOrder({"characterID", "name", "HP", "MP", "AP", "meleeDamage", "rangeCombatDamage", "rangeCombatReach"})
|
2021-05-31 15:50:15 +00:00
|
|
|
/**
|
|
|
|
* Represents properties of a character in the {@link CharacterConfig}.
|
|
|
|
*/
|
|
|
|
public class CharacterProperties {
|
2021-06-02 14:10:35 +00:00
|
|
|
public int characterID;
|
2021-05-31 15:50:15 +00:00
|
|
|
public String name;
|
|
|
|
public int HP;
|
|
|
|
public int MP;
|
|
|
|
public int AP;
|
|
|
|
public int meleeDamage;
|
|
|
|
@JsonProperty("rangeCombatDamage")
|
|
|
|
public int rangedDamage;
|
|
|
|
@JsonProperty("rangeCombatReach")
|
|
|
|
public int attackRange;
|
2021-06-02 14:10:35 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean equals(Object o) {
|
|
|
|
if (this == o) return true;
|
|
|
|
if (o == null || getClass() != o.getClass()) return false;
|
|
|
|
CharacterProperties that = (CharacterProperties) o;
|
|
|
|
return characterID == that.characterID && HP == that.HP && MP == that.MP && AP == that.AP && meleeDamage == that.meleeDamage && rangedDamage == that.rangedDamage && attackRange == that.attackRange && Objects.equals(name, that.name);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int hashCode() {
|
|
|
|
return Objects.hash(characterID, name, HP, MP, AP, meleeDamage, rangedDamage, attackRange);
|
|
|
|
}
|
2021-06-03 17:13:21 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "CharacterProperties{" +
|
|
|
|
"characterID=" + characterID +
|
|
|
|
", name='" + name + '\'' +
|
|
|
|
", HP=" + HP +
|
|
|
|
", MP=" + MP +
|
|
|
|
", AP=" + AP +
|
|
|
|
", meleeDamage=" + meleeDamage +
|
|
|
|
", rangedDamage=" + rangedDamage +
|
|
|
|
", attackRange=" + attackRange +
|
|
|
|
'}';
|
|
|
|
}
|
2021-05-31 15:50:15 +00:00
|
|
|
}
|