Browse Source

Document Attribute and make SkillInfo use attributes

master
Chris Smith 15 years ago
parent
commit
b24fa9e8f8

+ 5
- 4
src/uk/co/md87/evetool/api/wrappers/SkillList.java View File

@@ -28,6 +28,7 @@ import java.util.List;
28 28
 import java.util.Map;
29 29
 
30 30
 import uk.co.md87.evetool.api.parser.ApiElement;
31
+import uk.co.md87.evetool.api.wrappers.data.Attribute;
31 32
 import uk.co.md87.evetool.api.wrappers.data.SkillGroup;
32 33
 import uk.co.md87.evetool.api.wrappers.data.SkillInfo;
33 34
 import uk.co.md87.evetool.api.wrappers.data.SkillRequirement;
@@ -79,10 +80,10 @@ public class SkillList extends ArrayList<SkillGroup> {
79 80
         final String desc = row.getChildContent("description");
80 81
         final int rank = row.getNumericChildContent("rank");
81 82
         final List<SkillRequirement> reqs = getReqs(row.getRowset("requiredSkills"));
82
-        final String primaryAttribute = row.getChild("requiredAttributes")
83
-                .getChildContent("primaryAttribute");
84
-        final String secondaryAttribute = row.getChild("requiredAttributes")
85
-                .getChildContent("secondaryAttribute");
83
+        final Attribute primaryAttribute = Attribute.valueOf(row.getChild("requiredAttributes")
84
+                .getChildContent("primaryAttribute").toUpperCase());
85
+        final Attribute secondaryAttribute = Attribute.valueOf(row.getChild("requiredAttributes")
86
+                .getChildContent("secondaryAttribute").toUpperCase());
86 87
         final Map<String, String> bonuses = getBonuses(row.getRowset("skillBonusCollection"));
87 88
 
88 89
         return new SkillInfo(group, skillName, typeId, desc, rank, reqs, primaryAttribute,

+ 10
- 2
src/uk/co/md87/evetool/api/wrappers/data/Attribute.java View File

@@ -23,17 +23,25 @@
23 23
 package uk.co.md87.evetool.api.wrappers.data;
24 24
 
25 25
 /**
26
+ * An enumeration of the five attributes of a character.
26 27
  *
27
- * TODO: Document Attribute
28
- * TODO: Switch skill to use Attribute
29 28
  * @author chris
30 29
  */
31 30
 public enum Attribute {
32 31
 
32
+    /** The intelligence attribute. */
33 33
     INTELLIGENCE,
34
+
35
+    /** The memory attribute. */
34 36
     MEMORY,
37
+
38
+    /** The charisma attribute. */
35 39
     CHARISMA,
40
+
41
+    /** The perception attribute. */
36 42
     PERCEPTION,
43
+
44
+    /** The willpower attribute. */
37 45
     WILLPOWER;
38 46
 
39 47
 }

+ 3
- 3
src/uk/co/md87/evetool/api/wrappers/data/SkillInfo.java View File

@@ -38,14 +38,14 @@ public class SkillInfo {
38 38
     protected final String description;
39 39
     protected final int rank;
40 40
     protected final List<SkillRequirement> requirements;
41
-    protected final String primaryAttribute;
42
-    protected final String secondaryAttribute;
41
+    protected final Attribute primaryAttribute;
42
+    protected final Attribute secondaryAttribute;
43 43
     protected final Map<String, String> bonuses;
44 44
 
45 45
     public SkillInfo(final SkillGroup group, final String name, final int id,
46 46
             final String description, final int rank,
47 47
             final List<SkillRequirement> requirements,
48
-            final String primaryAttribute, final String secondaryAttribute,
48
+            final Attribute primaryAttribute, final Attribute secondaryAttribute,
49 49
             final Map<String, String> bonuses) {
50 50
         this.group = group;
51 51
         this.name = name;

Loading…
Cancel
Save