36 this.settings = Collections.unmodifiableMap(new HashMap<String, Integer>(settings)); |
36 this.settings = Collections.unmodifiableMap(new HashMap<String, Integer>(settings)); |
37 this.mods = Collections.unmodifiableMap(new HashMap<String, Boolean>(mods)); |
37 this.mods = Collections.unmodifiableMap(new HashMap<String, Boolean>(mods)); |
38 } |
38 } |
39 |
39 |
40 public int getHealth() { |
40 public int getHealth() { |
41 return settings.get("health"); |
41 Integer health = settings.get("health"); |
|
42 return health==null ? 100 : health.intValue(); |
42 } |
43 } |
43 |
44 |
44 @Override |
45 /*@Override |
45 public String toString() { |
46 public String toString() { |
46 return "Scheme [metascheme=" + metascheme + ", name=" + name |
47 return "Scheme [metascheme=" + metascheme + ", name=" + name |
47 + ", settings=" + settings + ", mods=" + mods + "]"; |
48 + ", settings=" + settings + ", mods=" + mods + "]"; |
|
49 }*/ |
|
50 |
|
51 @Override |
|
52 public String toString() { |
|
53 return name; // TODO change back once StartGameActivity does not need this anymore |
48 } |
54 } |
49 |
55 |
50 public static final Comparator<Scheme> caseInsensitiveNameComparator = new Comparator<Scheme>() { |
56 public static final Comparator<Scheme> caseInsensitiveNameComparator = new Comparator<Scheme>() { |
51 public int compare(Scheme lhs, Scheme rhs) { |
57 public int compare(Scheme lhs, Scheme rhs) { |
52 return lhs.name.compareToIgnoreCase(rhs.name); |
58 return lhs.name.compareToIgnoreCase(rhs.name); |