Gamelib/src/main/java/uulm/teamname/marvelous/gamelibrary/config/CharacterProperties.java

37 lines
1.3 KiB
Java
Raw Normal View History

package uulm.teamname.marvelous.gamelibrary.config;
2021-05-31 15:50:15 +00:00
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
2021-05-31 15:50:15 +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 {
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;
@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-05-31 15:50:15 +00:00
}