package uulm.teamname.marvelous.gamelibrary.config; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; import java.util.Objects; /** Represents properties of a character in the {@link CharacterConfig} */ @JsonPropertyOrder({"characterID", "name", "HP", "MP", "AP", "meleeDamage", "rangeCombatDamage", "rangeCombatReach"}) public class CharacterProperties { @NotNull @Positive public int characterID; @NotEmpty public String name; @NotNull @Positive public int HP; @NotNull @Positive public int MP; @NotNull @Positive public int AP; @NotNull @Positive public int meleeDamage; @NotNull @Positive @JsonProperty("rangeCombatDamage") public int rangedDamage; @NotNull @Positive @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); } @Override public String toString() { return "CharacterProperties{" + "characterID=" + characterID + ", name='" + name + '\'' + ", HP=" + HP + ", MP=" + MP + ", AP=" + AP + ", meleeDamage=" + meleeDamage + ", rangedDamage=" + rangedDamage + ", attackRange=" + attackRange + '}'; } }