Procházet zdrojové kódy

Attribute parsing

master
Chris Smith před 15 roky
rodič
revize
30378cccd8

+ 8
- 1
src/uk/co/md87/evetool/api/wrappers/CharacterSheet.java Zobrazit soubor

70
         parseImplants(resultElement.getChild("attributeEnhancers"));
70
         parseImplants(resultElement.getChild("attributeEnhancers"));
71
 
71
 
72
         this.attributes = new HashMap<Attribute, Integer>();
72
         this.attributes = new HashMap<Attribute, Integer>();
73
-        // TODO: Attributes
73
+        parseAttributes(resultElement.getChild("attributes"));
74
 
74
 
75
         this.skills = new ArrayList<TrainedSkillInfo>();
75
         this.skills = new ArrayList<TrainedSkillInfo>();
76
         parseSkills(resultElement.getRowset("skills"));
76
         parseSkills(resultElement.getRowset("skills"));
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
     protected void parseSkills(final ApiElement rowset) {
115
     protected void parseSkills(final ApiElement rowset) {
109
         // TODO: Nice way to quickly parse rowsets?
116
         // TODO: Nice way to quickly parse rowsets?
110
         for (ApiElement row : rowset.getChildren()) {
117
         for (ApiElement row : rowset.getChildren()) {

Načítá se…
Zrušit
Uložit