Browse Source

Attribute parsing

master
Chris Smith 15 years ago
parent
commit
30378cccd8
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      src/uk/co/md87/evetool/api/wrappers/CharacterSheet.java

+ 8
- 1
src/uk/co/md87/evetool/api/wrappers/CharacterSheet.java View File

@@ -70,7 +70,7 @@ public class CharacterSheet {
70 70
         parseImplants(resultElement.getChild("attributeEnhancers"));
71 71
 
72 72
         this.attributes = new HashMap<Attribute, Integer>();
73
-        // TODO: Attributes
73
+        parseAttributes(resultElement.getChild("attributes"));
74 74
 
75 75
         this.skills = new ArrayList<TrainedSkillInfo>();
76 76
         parseSkills(resultElement.getRowset("skills"));
@@ -105,6 +105,13 @@ public class CharacterSheet {
105 105
         }
106 106
     }
107 107
 
108
+    protected void parseAttributes(final ApiElement root) {
109
+        for (Attribute attribute : Attribute.values()) {
110
+            attributes.put(attribute,
111
+                    root.getNumericChildContent(attribute.name().toLowerCase()));
112
+        }
113
+    }
114
+
108 115
     protected void parseSkills(final ApiElement rowset) {
109 116
         // TODO: Nice way to quickly parse rowsets?
110 117
         for (ApiElement row : rowset.getChildren()) {

Loading…
Cancel
Save