guiVersion of project, rewriting code for maximum clarity

This commit is contained in:
Joshua-Ashton01
2022-11-08 17:14:43 -07:00
parent 823683e5c4
commit b06a6021c8
29 changed files with 142 additions and 109 deletions
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
@@ -0,0 +1,55 @@
package AbilityScores;
public class Charisma extends Stats {
private int abilityScore;
private int abilityScoreModifier;
public Charisma(int abilityScore) {
this.abilityScore = abilityScore;
this.abilityScoreModifier = calcSavingThrow(abilityScore);
}
public int getScore() {
return abilityScore;
}
public int getModifier() {
return abilityScoreModifier;
}
public int getSavingThrow() {
return getModifier();
}
// TODO: Need description.
public String getDescription() {
return "Confidence, eloquence, and leadership.";
}
@Override
public String toString() {
return "Ability Score: " + abilityScore + " | Modifier: " + abilityScoreModifier + " | Description: "
+ getDescription();
}
@Override
void increaseScore() {
abilityScore++;
}
}
@@ -0,0 +1,55 @@
package AbilityScores;
public class Constitution extends Stats {
private int abilityScore;
private int abilityScoreModifier;
public Constitution(int abilityScore) {
this.abilityScore = abilityScore;
this.abilityScoreModifier = calcSavingThrow(abilityScore);
}
public int getScore() {
return abilityScore;
}
public int getModifier() {
return abilityScoreModifier;
}
public int getSavingThrow() {
return getModifier();
}
// TODO: Need description.
public String getDescription() {
return "Health, stamina, vital force.";
}
@Override
public String toString() {
return "Ability Score: " + abilityScore + " | Modifier: " + abilityScoreModifier + " | Description: "
+ getDescription();
}
@Override
void increaseScore() {
abilityScore++;
}
}
@@ -0,0 +1,55 @@
package AbilityScores;
public class Dexterity extends Stats {
private int abilityScore;
private int abilityScoreModifier;
public Dexterity(int abilityScore) {
this.abilityScore = abilityScore;
this.abilityScoreModifier = calcSavingThrow(abilityScore);
}
public int getScore() {
return abilityScore;
}
public int getModifier() {
return abilityScoreModifier;
}
public int getSavingThrow() {
return getModifier();
}
// TODO: Need description.
public String getDescription() {
return "";
}
@Override
public String toString() {
return "Ability Score: " + abilityScore + " | Modifier: " + abilityScoreModifier + " | Description: "
+ getDescription();
}
@Override
void increaseScore() {
abilityScore++;
}
}
@@ -0,0 +1,55 @@
package AbilityScores;
public class Intelligence extends Stats{
private int abilityScore;
private int abilityScoreModifier;
public Intelligence(int abilityScore) {
this.abilityScore = abilityScore;
this.abilityScoreModifier = calcSavingThrow(abilityScore);
}
public int getScore() {
return abilityScore;
}
public int getModifier() {
return abilityScoreModifier;
}
public int getSavingThrow() {
return getModifier();
}
// TODO: Need description.
public String getDescription() {
return "";
}
@Override
public String toString() {
return "Ability Score: " + abilityScore + " | Modifier: " + abilityScoreModifier + " | Description: "
+ getDescription();
}
@Override
void increaseScore() {
abilityScore++;
}
}
+56
View File
@@ -0,0 +1,56 @@
package AbilityScores;
public abstract class Stats {
public int calcSavingThrow(int abilityScore) {
switch (abilityScore) {
case 1:
return -5;
case 2:
case 3:
return -4;
case 4:
case 5:
return -3;
case 6:
case 7:
return -2;
case 8:
case 9:
return -1;
case 10:
case 11:
return 0;
case 12:
case 13:
return 1;
case 14:
case 15:
return 2;
case 16:
case 17:
return 3;
case 18:
case 19:
return 4;
case 20:
return 5;
default:
return 0;
}
}
abstract void increaseScore();
abstract int getScore();
abstract int getModifier();
abstract int getSavingThrow();
abstract String getDescription();
}
@@ -0,0 +1,67 @@
package AbilityScores;
public class Strength extends Stats {
private int abilityScore;
private int abilityScoreModifier;
public Strength(int abilityScore) {
this.abilityScore = abilityScore;
this.abilityScoreModifier = calcSavingThrow(abilityScore);
}
public Strength(Strength str) {
this.abilityScore = str.getScore();
this.abilityScoreModifier = str.getModifier();
}
public int getScore() {
return abilityScore;
}
public int getModifier() {
return abilityScoreModifier;
}
public int getSavingThrow() {
return getModifier();
}
public String getDescription() {
return "Natural athleticism and bodily power.";
}
public int getMaxCarryWeight() {
return abilityScore * 15;
}
@Override
public String toString() {
return "Ability Score: " + abilityScore + " | Modifier: " + abilityScoreModifier + " | Description: "
+ getDescription();
}
@Override
void increaseScore() {
abilityScore++;
}
}
+55
View File
@@ -0,0 +1,55 @@
package AbilityScores;
public class Wisdom extends Stats {
private int abilityScore;
private int abilityScoreModifier;
public Wisdom(int abilityScore) {
this.abilityScore = abilityScore;
this.abilityScoreModifier = calcSavingThrow(abilityScore);
}
public int getScore() {
return abilityScore;
}
public int getModifier() {
return abilityScoreModifier;
}
public int getSavingThrow() {
return getModifier();
}
// TODO: Need description.
public String getDescription() {
return "";
}
@Override
public String toString() {
return "Ability Score: " + abilityScore + " | Modifier: " + abilityScoreModifier + " | Description: "
+ getDescription();
}
@Override
void increaseScore() {
abilityScore++;
}
}
+37
View File
@@ -0,0 +1,37 @@
package Classes;
public interface ClassTemplate {
String getDescription();
String[] getProgression();
String[] getClassFeatures();
String getHitDie();
int getHPatLv1();
int getHPpastLv1();
String[] getArmorProf();
String[] getWeaponProf();
String[] getToolProf();
String[] getSavingThrows();
// TODO: Need to refresh on how saving throws work and how the character's class may impact a saving throw.
String[] availableSkills();
String[] startingEquipChoices();
boolean advantageCheck(Stats abilityScore);
boolean disadvantageCheck(Stats abilityScore);
// TODO: Spells and shit.
}
+91
View File
@@ -0,0 +1,91 @@
package Classes;
public class Cleric implements ClassTemplate {
private int HP;
private int level;
// TODO: This should be the type of die.
private int hitDie;
public Cleric(Stats[] stats, int level) {
}
// TODO: Need to figure out how to contain class progression information. Potentially a double String array, each row equals a level, each column a different thing. Should class features be a separate class, ie. BarbFeatures, BardFeatures, etc?
public String getDescription() {
// TODO Auto-generated method stub
return null;
}
public String[] getProgression() {
// TODO Auto-generated method stub
return null;
}
public String[] getClassFeatures() {
// TODO Auto-generated method stub
return null;
}
public String getHitDie() {
// TODO Auto-generated method stub
return null;
}
public int getHPatLv1() {
// TODO Auto-generated method stub
return 0;
}
public int getHPpastLv1() {
// TODO Auto-generated method stub
return 0;
}
public String[] getArmorProf() {
// TODO Auto-generated method stub
return null;
}
public String[] getWeaponProf() {
// TODO Auto-generated method stub
return null;
}
public String[] getToolProf() {
// TODO Auto-generated method stub
return null;
}
public String[] availableSkills() {
// TODO Auto-generated method stub
return null;
}
public String[] startingEquipChoices() {
// TODO Auto-generated method stub
return null;
}
public boolean advantageCheck(Stats abilityScore) {
// TODO Auto-generated method stub
return false;
}
public boolean disadvantageCheck(Stats abilityScore) {
// TODO Auto-generated method stub
return false;
}
@Override
public String[] getSavingThrows() {
// TODO Auto-generated method stub
return null;
}
}
+91
View File
@@ -0,0 +1,91 @@
package Classes;
public class Fighter implements ClassTemplate {
private int HP;
private int level;
// TODO: This should be the type of die.
private int hitDie;
public Fighter(Stats[] stats, int level) {
}
// TODO: Need to figure out how to contain class progression information. Potentially a double String array, each row equals a level, each column a different thing. Should class features be a separate class, ie. BarbFeatures, BardFeatures, etc?
public String getDescription() {
// TODO Auto-generated method stub
return null;
}
public String[] getProgression() {
// TODO Auto-generated method stub
return null;
}
public String[] getClassFeatures() {
// TODO Auto-generated method stub
return null;
}
public String getHitDie() {
// TODO Auto-generated method stub
return null;
}
public int getHPatLv1() {
// TODO Auto-generated method stub
return 0;
}
public int getHPpastLv1() {
// TODO Auto-generated method stub
return 0;
}
public String[] getArmorProf() {
// TODO Auto-generated method stub
return null;
}
public String[] getWeaponProf() {
// TODO Auto-generated method stub
return null;
}
public String[] getToolProf() {
// TODO Auto-generated method stub
return null;
}
public String[] availableSkills() {
// TODO Auto-generated method stub
return null;
}
public String[] startingEquipChoices() {
// TODO Auto-generated method stub
return null;
}
public boolean advantageCheck(Stats abilityScore) {
// TODO Auto-generated method stub
return false;
}
public boolean disadvantageCheck(Stats abilityScore) {
// TODO Auto-generated method stub
return false;
}
@Override
public String[] getSavingThrows() {
// TODO Auto-generated method stub
return null;
}
}
+91
View File
@@ -0,0 +1,91 @@
package Classes;
public class Wizard implements ClassTemplate {
private int HP;
private int level;
// TODO: This should be the type of die.
private int hitDie;
public Wizard(Stats[] stats, int level) {
}
// TODO: Need to figure out how to contain class progression information. Potentially a double String array, each row equals a level, each column a different thing. Should class features be a separate class, ie. BarbFeatures, BardFeatures, etc?
public String getDescription() {
// TODO Auto-generated method stub
return null;
}
public String[] getProgression() {
// TODO Auto-generated method stub
return null;
}
public String[] getClassFeatures() {
// TODO Auto-generated method stub
return null;
}
public String getHitDie() {
// TODO Auto-generated method stub
return null;
}
public int getHPatLv1() {
// TODO Auto-generated method stub
return 0;
}
public int getHPpastLv1() {
// TODO Auto-generated method stub
return 0;
}
public String[] getArmorProf() {
// TODO Auto-generated method stub
return null;
}
public String[] getWeaponProf() {
// TODO Auto-generated method stub
return null;
}
public String[] getToolProf() {
// TODO Auto-generated method stub
return null;
}
public String[] availableSkills() {
// TODO Auto-generated method stub
return null;
}
public String[] startingEquipChoices() {
// TODO Auto-generated method stub
return null;
}
public boolean advantageCheck(Stats abilityScore) {
// TODO Auto-generated method stub
return false;
}
public boolean disadvantageCheck(Stats abilityScore) {
// TODO Auto-generated method stub
return false;
}
@Override
public String[] getSavingThrows() {
// TODO Auto-generated method stub
return null;
}
}
+16
View File
@@ -0,0 +1,16 @@
import GUI.*;
import Races.*;
import Classes.*;
import AbilityScores.*;
public class DndCharacterBuilder {
public static void main(String[] args) {
PanelHolder guiPanels = new PanelHolder();
UImanager gui = new UImanager(guiPanels);
}
}
+147
View File
@@ -0,0 +1,147 @@
package GUI;
import javax.swing.*;
public class PanelHolder {
private JPanel mainMenuPanel;
private JPanel racePanel;
private JPanel classPanel;
private JPanel abilityScorePanel;
private JPanel descriptionPanel;
private JPanel equipmentPanel;
private JPanel finalizePanel;
private JPanel loadMenuPanel;
public PanelHolder() {
this.mainMenuPanel = createMainMenuPanel();
this.racePanel = createRaceSelectPanel();
this.classPanel = createClassSelectPanel();
this.abilityScorePanel = createAbilityScoreSelectPanel();
this.descriptionPanel = createDescriptionPanel();
this.equipmentPanel = createEquipmentSelectPanel();
this.finalizePanel = createFinalizePanel();
this.loadMenuPanel = createLoadMenu();
}
public JPanel getMainMenuPanel() {
return mainMenuPanel;
}
public JPanel getRacePanel() {
return racePanel;
}
public JPanel getClassPanel() {
return classPanel;
}
public JPanel getAbilityScorePanel() {
return abilityScorePanel;
}
public JPanel getDescriptionPanel() {
return descriptionPanel;
}
public JPanel getEquipmentPanel() {
return equipmentPanel;
}
public JPanel getFinalizePanel() {
return finalizePanel;
}
public JPanel getLoadMenuPanel() {
return loadMenuPanel;
}
/* TODO: Need to implement.
LEFT-SIDE: Two large buttons, split with a horizontal line. One is to create a new DnD character, the other is to create a
random character.
RIGHT-SIDE: One extra-large button to load an existing character.
*/
private JPanel createMainMenuPanel() {
return new JPanel();
}
/* TODO: Need to implement.
LEFT-SIDE: Should appear with a random portrait of the default race, human. Below this
portrait, a button for the user to upload their own portrait.
RIGHT-SIDE: Should appear with a scrollable list of the user's available races. A tooltip is on each race, and expands to
describe the race, their proficiencies, languages, and ability score improvements.
*/
private JPanel createRaceSelectPanel() {
return new JPanel();
}
// TODO: Need to implement.
private JPanel createClassSelectPanel() {
return new JPanel();
}
// TODO: Need to implement.
private JPanel createAbilityScoreSelectPanel() {
return new JPanel();
}
// TODO: Need to implement.
private JPanel createDescriptionPanel() {
return new JPanel();
}
// TODO: Need to implement.
private JPanel createEquipmentSelectPanel() {
return new JPanel();
}
// TODO: Need to implement.
private JPanel createFinalizePanel() {
return new JPanel();
}
// TODO: Need to implement.
private JPanel createLoadMenu() {
return new JPanel();
}
}
+69
View File
@@ -0,0 +1,69 @@
package GUI;
import javax.swing.*;
public class UImanager {
private final JFrame gui;
private final PanelHolder guiPanels;
private int currentPanel;
public UImanager (PanelHolder guiPanels) {
this.gui = new JFrame("D&D Character Builder");
this.guiPanels = guiPanels;
if (returningUser()) {
this.currentPanel = 0;
} else {
this.currentPanel = 1;
}
frameSetup();
}
// TODO: Need to implement.
private void frameSetup() {
}
// TODO: Need to implement.
private boolean returningUser() {
return false;
}
private JPanel getNextPanel() {
return switch (currentPanel) {
case 1 -> guiPanels.getRacePanel();
case 2 -> guiPanels.getClassPanel();
case 3 -> guiPanels.getAbilityScorePanel();
case 4 -> guiPanels.getDescriptionPanel();
case 5 -> guiPanels.getEquipmentPanel();
case 6 -> guiPanels.getLoadMenuPanel();
case 7 -> guiPanels.getFinalizePanel();
default -> guiPanels.getMainMenuPanel();
};
}
private void clearAndReset(JPanel nextPanel) {
gui.removeAll();
gui.add(nextPanel);
gui.repaint();
gui.revalidate();
}
}
+72
View File
@@ -0,0 +1,72 @@
package Races;
public class Dragonborn implements Race{
private String[] traits;
private final int speed = 30;
private final int maxAge = 80;
private String[] skills;
private String[] languages;
private String[] proficiencies;
public Dragonborn() {
this.languages = new String[] {"Common", "Draconic"};
this.skills = new String[] {};
}
@Override
public String getRace() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
@Override
public int maxAge() {
// TODO Auto-generated method stub
return maxAge;
}
@Override
public int getSpeed() {
// TODO Auto-generated method stub
return speed;
}
@Override
public String[] getTraits() {
// TODO Auto-generated method stub
return traits;
}
@Override
public String[] getSkills() {
// TODO Auto-generated method stub
return skills;
}
@Override
public String[] getLanguages() {
// TODO Auto-generated method stub
return languages;
}
@Override
public String[] getProficiencies() {
// TODO Auto-generated method stub
return proficiencies;
}
@Override
public int[] getASI() {
// TODO Auto-generated method stub
return new int[]{0,0,5};
}
@Override
public String toString() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
}
+72
View File
@@ -0,0 +1,72 @@
package Races;
public class Dwarf implements Race{
private String[] traits;
private final int speed = 25;
private final int maxAge = 350;
private String[] skills;
private String[] languages;
private String[] proficiencies;
public Dwarf() {
this.languages = new String[] {"Common", "Dwarvish"};
this.skills = new String[] {};
}
@Override
public String getRace() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
@Override
public int maxAge() {
// TODO Auto-generated method stub
return maxAge;
}
@Override
public int getSpeed() {
// TODO Auto-generated method stub
return speed;
}
@Override
public String[] getTraits() {
// TODO Auto-generated method stub
return traits;
}
@Override
public String[] getSkills() {
// TODO Auto-generated method stub
return skills;
}
@Override
public String[] getLanguages() {
// TODO Auto-generated method stub
return languages;
}
@Override
public String[] getProficiencies() {
// TODO Auto-generated method stub
return proficiencies;
}
@Override
public int[] getASI() {
// TODO Auto-generated method stub
return new int[]{2,2};
}
@Override
public String toString() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
}
+72
View File
@@ -0,0 +1,72 @@
package Races;
public class Elf implements Race{
private String[] traits;
private final int speed = 30;
private final int maxAge = 750;
private String[] skills;
private String[] languages;
private String[] proficiencies;
public Elf() {
this.languages = new String[] {"Common", "Elvish"};
this.skills = new String[] {};
}
@Override
public String getRace() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
@Override
public int maxAge() {
// TODO Auto-generated method stub
return maxAge;
}
@Override
public int getSpeed() {
// TODO Auto-generated method stub
return speed;
}
@Override
public String[] getTraits() {
// TODO Auto-generated method stub
return traits;
}
@Override
public String[] getSkills() {
// TODO Auto-generated method stub
return skills;
}
@Override
public String[] getLanguages() {
// TODO Auto-generated method stub
return languages;
}
@Override
public String[] getProficiencies() {
// TODO Auto-generated method stub
return proficiencies;
}
@Override
public int[] getASI() {
// TODO Auto-generated method stub
return new int[]{1,1};
}
@Override
public String toString() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
}
+72
View File
@@ -0,0 +1,72 @@
package Races;
public class Gnome implements Race{
private String[] traits;
private final int speed = 25;
private final int maxAge = 500;
private String[] skills;
private String[] languages;
private String[] proficiencies;
public Gnome() {
this.languages = new String[] {"Common", "Gnomish"};
this.skills = new String[] {};
}
@Override
public String getRace() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
@Override
public int maxAge() {
// TODO Auto-generated method stub
return maxAge;
}
@Override
public int getSpeed() {
// TODO Auto-generated method stub
return speed;
}
@Override
public String[] getTraits() {
// TODO Auto-generated method stub
return traits;
}
@Override
public String[] getSkills() {
// TODO Auto-generated method stub
return skills;
}
@Override
public String[] getLanguages() {
// TODO Auto-generated method stub
return languages;
}
@Override
public String[] getProficiencies() {
// TODO Auto-generated method stub
return proficiencies;
}
@Override
public int[] getASI() {
// TODO Auto-generated method stub
return new int[]{3,3};
}
@Override
public String toString() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
}
+77
View File
@@ -0,0 +1,77 @@
package Races;
public class HalfElf implements Race{
private String[] traits;
private final int speed = 30;
private final int maxAge = 180;
private String[] skills;
private String[] languages;
private String[] proficiencies;
private int chosenASI;
//TODO HalfElf get's to increase 1 ASI of their choice to increase.
public HalfElf(String chosenLanguage, int chosenASI) {
this.languages = new String[] {"Common", "Elvish", chosenLanguage };
this.skills = new String[] {};
this.chosenASI = chosenASI;
}
@Override
public String getRace() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
@Override
public int maxAge() {
// TODO Auto-generated method stub
return maxAge;
}
@Override
public int getSpeed() {
// TODO Auto-generated method stub
return speed;
}
@Override
public String[] getTraits() {
// TODO Auto-generated method stub
return traits;
}
@Override
public String[] getSkills() {
// TODO Auto-generated method stub
return skills;
}
@Override
public String[] getLanguages() {
// TODO Auto-generated method stub
return languages;
}
@Override
public String[] getProficiencies() {
// TODO Auto-generated method stub
return proficiencies;
}
@Override
public int[] getASI() {
// TODO Auto-generated method stub
return new int[]{5,5, chosenASI};
}
@Override
public String toString() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
}
+72
View File
@@ -0,0 +1,72 @@
package Races;
public class HalfOrc implements Race{
private String[] traits;
private final int speed = 30;
private final int maxAge = 75;
private String[] skills;
private String[] languages;
private String[] proficiencies;
public HalfOrc() {
this.languages = new String[] {"Common", "Orc"};
this.skills = new String[] {};
}
@Override
public String getRace() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
@Override
public int maxAge() {
// TODO Auto-generated method stub
return maxAge;
}
@Override
public int getSpeed() {
// TODO Auto-generated method stub
return speed;
}
@Override
public String[] getTraits() {
// TODO Auto-generated method stub
return traits;
}
@Override
public String[] getSkills() {
// TODO Auto-generated method stub
return skills;
}
@Override
public String[] getLanguages() {
// TODO Auto-generated method stub
return languages;
}
@Override
public String[] getProficiencies() {
// TODO Auto-generated method stub
return proficiencies;
}
@Override
public int[] getASI() {
// TODO Auto-generated method stub
return new int[]{0,0,2};
}
@Override
public String toString() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
}
+73
View File
@@ -0,0 +1,73 @@
package Races;
public class Halfling implements Race{
private String[] traits;
private final int speed = 30;
private final int maxAge = 750;
private String[] skills;
private String[] languages;
private String[] proficiencies;
public Halfling() {
this.languages = new String[] {"Common", "Elvish"};
this.skills = new String[] {};
}
@Override
public String getRace() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
@Override
public int maxAge() {
// TODO Auto-generated method stub
return maxAge;
}
@Override
public int getSpeed() {
// TODO Auto-generated method stub
return speed;
}
@Override
public String[] getTraits() {
// TODO Auto-generated method stub
return traits;
}
@Override
public String[] getSkills() {
// TODO Auto-generated method stub
return skills;
}
@Override
public String[] getLanguages() {
// TODO Auto-generated method stub
return languages;
}
@Override
public String[] getProficiencies() {
// TODO Auto-generated method stub
return proficiencies;
}
@Override
public int[] getASI() {
// TODO Auto-generated method stub
return new int[]{1,1};
}
@Override
public String toString() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
}
+74
View File
@@ -0,0 +1,74 @@
package Races;
public class Human implements Race {
private String[] traits;
private final int speed = 30;
private final int maxAge = 80;
private String[] skills;
private String[] languages;
private String[] proficiencies;
public Human(String chosenLanguage) {
this.languages = new String[] {"Common", chosenLanguage};
this.skills = new String[] {};
}
@Override
public String getRace() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
@Override
public int maxAge() {
// TODO Auto-generated method stub
return maxAge;
}
@Override
public int getSpeed() {
// TODO Auto-generated method stub
return speed;
}
@Override
public String[] getTraits() {
// TODO Auto-generated method stub
return traits;
}
@Override
public String[] getSkills() {
// TODO Auto-generated method stub
return skills;
}
@Override
public String[] getLanguages() {
// TODO Auto-generated method stub
return languages;
}
@Override
public String[] getProficiencies() {
// TODO Auto-generated method stub
return proficiencies;
}
@Override
public int[] getASI() {
// TODO Auto-generated method stub
return new int[]{0, 1, 2, 3, 4, 5};
}
@Override
public String toString() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
}
+50
View File
@@ -0,0 +1,50 @@
package Races;
import java.util.ArrayList;
public interface Race {
String getRace();
int maxAge();
int getSpeed();
String[] getTraits();
String[] getSkills();
String[] getLanguages();
String[] getProficiencies();
int[] getASI();
// private ArrayList<String> traits;
// private ArrayList<String> skills;
// private ArrayList<String> laugnuage;
// //private Subrace subrase;
// private ArrayList<String> proficiencies;
// /**
// * @param raceName
// * @param ageRange
// * @param speed
// * @param traits
// * @param skills
// * @param laugnuage
// * @param proficiencies
// */
// public Race(String raceName, String ageRange, int speed, ArrayList<String> traits, ArrayList<String> skills,
// ArrayList<String> laugnuage, ArrayList<String> proficiencies) {
// this.raceName = raceName;
// this.ageRange = ageRange;
// this.speed = speed;
// this.traits = traits;
// this.skills = skills;
// this.laugnuage = laugnuage;
// this.proficiencies = proficiencies;
// }
}
+72
View File
@@ -0,0 +1,72 @@
package Races;
public class Tiefling implements Race{
private String[] traits;
private final int speed = 30;
private final int maxAge = 85;
private String[] skills;
private String[] languages;
private String[] proficiencies;
public Tiefling() {
this.languages = new String[] {"Common", "Infernal"};
this.skills = new String[] {};
}
@Override
public String getRace() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
@Override
public int maxAge() {
// TODO Auto-generated method stub
return maxAge;
}
@Override
public int getSpeed() {
// TODO Auto-generated method stub
return speed;
}
@Override
public String[] getTraits() {
// TODO Auto-generated method stub
return traits;
}
@Override
public String[] getSkills() {
// TODO Auto-generated method stub
return skills;
}
@Override
public String[] getLanguages() {
// TODO Auto-generated method stub
return languages;
}
@Override
public String[] getProficiencies() {
// TODO Auto-generated method stub
return proficiencies;
}
@Override
public int[] getASI() {
// TODO Auto-generated method stub
return new int[]{3,5,5};
}
@Override
public String toString() {
// TODO Auto-generated method stub
return this.getClass().getSimpleName();
}
}