Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class hero {
- /**
- * creates a hero object
- */
- private int charisma;
- private int perception;
- private int strength;
- private int dexterity;
- private String name;
- private String bio;
- public hero() {
- this.charisma = 0;
- this.perception = 0;
- this.strength = 0;
- this.dexterity = 0;
- this.name = "No name";
- this.bio = "No name has no bio yet. His adventure has only begun and only time and effort will craft a bio for him.";
- }
- public hero(String[] hero) {
- this.charisma = Integer.parseInt(hero[2]);
- this.perception = Integer.parseInt(hero[3]);
- this.strength = Integer.parseInt(hero[4]);
- this.dexterity = Integer.parseInt(hero[5]);
- this.name = hero[0];
- this.bio = hero[1];
- }
- public hero(String heroData) {
- String[] heroinfo = heroData.split("[,]",0);
- hero(heroinfo);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement