Преглед на файлове

Document Attribute and make SkillInfo use attributes

master
Chris Smith преди 15 години
родител
ревизия
b24fa9e8f8

+ 5
- 4
src/uk/co/md87/evetool/api/wrappers/SkillList.java Целия файл

28
 import java.util.Map;
28
 import java.util.Map;
29
 
29
 
30
 import uk.co.md87.evetool.api.parser.ApiElement;
30
 import uk.co.md87.evetool.api.parser.ApiElement;
31
+import uk.co.md87.evetool.api.wrappers.data.Attribute;
31
 import uk.co.md87.evetool.api.wrappers.data.SkillGroup;
32
 import uk.co.md87.evetool.api.wrappers.data.SkillGroup;
32
 import uk.co.md87.evetool.api.wrappers.data.SkillInfo;
33
 import uk.co.md87.evetool.api.wrappers.data.SkillInfo;
33
 import uk.co.md87.evetool.api.wrappers.data.SkillRequirement;
34
 import uk.co.md87.evetool.api.wrappers.data.SkillRequirement;
79
         final String desc = row.getChildContent("description");
80
         final String desc = row.getChildContent("description");
80
         final int rank = row.getNumericChildContent("rank");
81
         final int rank = row.getNumericChildContent("rank");
81
         final List<SkillRequirement> reqs = getReqs(row.getRowset("requiredSkills"));
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
         final Map<String, String> bonuses = getBonuses(row.getRowset("skillBonusCollection"));
87
         final Map<String, String> bonuses = getBonuses(row.getRowset("skillBonusCollection"));
87
 
88
 
88
         return new SkillInfo(group, skillName, typeId, desc, rank, reqs, primaryAttribute,
89
         return new SkillInfo(group, skillName, typeId, desc, rank, reqs, primaryAttribute,

+ 10
- 2
src/uk/co/md87/evetool/api/wrappers/data/Attribute.java Целия файл

23
 package uk.co.md87.evetool.api.wrappers.data;
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
  * @author chris
28
  * @author chris
30
  */
29
  */
31
 public enum Attribute {
30
 public enum Attribute {
32
 
31
 
32
+    /** The intelligence attribute. */
33
     INTELLIGENCE,
33
     INTELLIGENCE,
34
+
35
+    /** The memory attribute. */
34
     MEMORY,
36
     MEMORY,
37
+
38
+    /** The charisma attribute. */
35
     CHARISMA,
39
     CHARISMA,
40
+
41
+    /** The perception attribute. */
36
     PERCEPTION,
42
     PERCEPTION,
43
+
44
+    /** The willpower attribute. */
37
     WILLPOWER;
45
     WILLPOWER;
38
 
46
 
39
 }
47
 }

+ 3
- 3
src/uk/co/md87/evetool/api/wrappers/data/SkillInfo.java Целия файл

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

Loading…
Отказ
Запис