Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public hero(String[] hero) {
- /**
- * takes a string array and constructs a hero object.
- */
- 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) {
- this(heroData.split("[,]",0));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement