Standardizing the 6 stats classes

This commit is contained in:
Joshua-Ashton01
2022-10-11 10:10:37 -06:00
parent b96f99c6cf
commit 2fd26cf0d0
15 changed files with 199 additions and 77 deletions
@@ -6,22 +6,57 @@ public class CharacterStats {
public CharacterStats() {
stats = new Stats[]{};
}
// TODO: Need to implement constructor, validates all proposed ability scores and creates new objects containing corresponding values.
public CharacterStats(int str, int dex, int con, int intel, int wis, int cha) {
this.stats = new Stats[]{
new Strength(str),
new Dexterity(dex),
new Constitution(con),
new Intelligence(intel),
new Wisdom(wis),
new Charisma(cha)
};
}
// FIXME: Need to implement constructor, validates all proposed ability scores and creates new objects containing corresponding values.
public CharacterStats(Strength str, Dexterity dex, Constitution con, Intelligence intel, Wisdom wis, Charisma cha) {
this.stats = new Stats[]{str, dex, con, intel, wis, cha};
}
// FIXME: Need to implement ability score validation.
// TODO: Need to implement ability score validation.
public boolean validateAbilityScore(int abilityScore) {
return false;
}
public Stats[] getStats() {
return stats;
}
/**
*
* Allows for access to a particular stat.
*
* @param int stat
* @return a specific stat
*
*/
public Stats getStats(int stat) {
return stats[stat];
}
}