|
@@ -60,28 +60,52 @@ public class CharacterSheet {
|
60
|
60
|
this.race = resultElement.getChild("race").getContent();
|
61
|
61
|
this.bloodline = resultElement.getChild("bloodLine").getContent();
|
62
|
62
|
this.gender = resultElement.getChild("gender").getContent();
|
|
63
|
+ this.balance = Double.parseDouble(resultElement.getChild("balance").getContent());
|
|
64
|
+
|
63
|
65
|
this.clone = new BasicCloneInfo();
|
64
|
66
|
// TODO: Clone
|
65
|
|
- this.balance = Double.parseDouble(resultElement.getChild("balance").getContent());
|
|
67
|
+
|
66
|
68
|
this.implants = new ArrayList<Implant>();
|
67
|
69
|
// TODO: Implants
|
|
70
|
+
|
68
|
71
|
this.attributes = new HashMap<Attribute, Integer>();
|
69
|
72
|
// TODO: Attributes
|
|
73
|
+
|
70
|
74
|
this.skills = new ArrayList<TrainedSkill>();
|
71
|
|
- // TODO: Skills
|
|
75
|
+ parseSkills(resultElement.getRowset("skills"));
|
|
76
|
+
|
72
|
77
|
this.certificates = new ArrayList<Integer>();
|
73
|
|
- // TODO: Certs
|
|
78
|
+ parseCertificates(resultElement.getRowset("certificates"));
|
74
|
79
|
|
75
|
80
|
final int id = Integer.parseInt(resultElement.getChild("characterID").getContent());
|
76
|
81
|
final String name = resultElement.getChild("name").getContent();
|
77
|
82
|
|
78
|
83
|
final String corpName = resultElement.getChild("corporationName").getContent();
|
79
|
|
- final int corpId = Integer.parseInt(resultElement.getChild("corporationID").getContent());
|
|
84
|
+ final int corpId = Integer.parseInt(resultElement
|
|
85
|
+ .getChild("corporationID").getContent());
|
80
|
86
|
|
81
|
87
|
charInfo = new BasicCharInfo(name, id, new BasicCorpInfo(corpName, corpId));
|
82
|
88
|
}
|
83
|
89
|
|
84
|
|
- protected BasicCharInfo getBasicInformation() {
|
|
90
|
+ protected void parseSkills(final ApiElement rowset) {
|
|
91
|
+ // TODO: Nice methods in ApiElement for getting [numeric] atts/children
|
|
92
|
+ // TODO: Nice way to quickly parse rowsets?
|
|
93
|
+ for (ApiElement row : rowset.getChildren()) {
|
|
94
|
+ final int id = Integer.parseInt(row.getAttributes().get("typeID"));
|
|
95
|
+ final int level = Integer.parseInt(row.getAttributes().get("level"));
|
|
96
|
+ final int sp = Integer.parseInt(row.getAttributes().get("skillpoints"));
|
|
97
|
+ skills.add(new TrainedSkill(id, level, sp));
|
|
98
|
+ }
|
|
99
|
+ }
|
|
100
|
+
|
|
101
|
+ protected void parseCertificates(final ApiElement rowset) {
|
|
102
|
+ for (ApiElement row : rowset.getChildren()) {
|
|
103
|
+ final int id = Integer.parseInt(row.getAttributes().get("certificateID"));
|
|
104
|
+ certificates.add(id);
|
|
105
|
+ }
|
|
106
|
+ }
|
|
107
|
+
|
|
108
|
+ public BasicCharInfo getBasicInformation() {
|
85
|
109
|
return charInfo;
|
86
|
110
|
}
|
87
|
111
|
|