Standardizing the 6 stats classes
This commit is contained in:
@@ -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];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user