27
27
*/
28
28
package mekhq .campaign .personnel ;
29
29
30
- import megamek .common .annotations .Nullable ;
31
- import megamek .common .options .*;
32
- import megamek .logging .MMLogger ;
33
-
34
30
import java .util .Enumeration ;
35
31
import java .util .Hashtable ;
36
32
import java .util .List ;
37
33
import java .util .Vector ;
38
34
35
+ import megamek .common .annotations .Nullable ;
36
+ import megamek .common .options .AbstractOptionsInfo ;
37
+ import megamek .common .options .IBasicOptionGroup ;
38
+ import megamek .common .options .IOption ;
39
+ import megamek .common .options .IOptionGroup ;
40
+ import megamek .common .options .IOptionInfo ;
41
+ import megamek .common .options .OptionsConstants ;
42
+ import megamek .common .options .PilotOptions ;
43
+ import megamek .logging .MMLogger ;
44
+
39
45
/**
40
- * An extension of PilotOptions that adds MekHQ-specific SPAs and edge triggers
41
- * for support and command
42
- * actions. Display names and descriptions are taken from SpecialAbility when
43
- * present, otherwise
44
- * from the MM option.
46
+ * An extension of PilotOptions that adds MekHQ-specific SPAs and edge triggers for support and command actions. Display
47
+ * names and descriptions are taken from SpecialAbility when present, otherwise from the MM option.
45
48
*
46
49
* @author Neoancient
47
50
*/
@@ -59,6 +62,7 @@ public class PersonnelOptions extends PilotOptions {
59
62
public static final String TECH_ENGINEER = "tech_engineer" ;
60
63
public static final String TECH_FIXER = "tech_fixer" ;
61
64
public static final String TECH_MAINTAINER = "tech_maintainer" ;
65
+ public static final String FLAW_GLASS_JAW = "flaw_glass_jaw" ;
62
66
63
67
@ Override
64
68
public void initialize () {
@@ -67,7 +71,7 @@ public void initialize() {
67
71
IBasicOptionGroup l3a = null ;
68
72
IBasicOptionGroup edge = null ;
69
73
IBasicOptionGroup md = null ;
70
- for (Enumeration <IBasicOptionGroup > e = getOptionsInfoImp ().getGroups (); e .hasMoreElements ();) {
74
+ for (Enumeration <IBasicOptionGroup > e = getOptionsInfoImp ().getGroups (); e .hasMoreElements (); ) {
71
75
final IBasicOptionGroup group = e .nextElement ();
72
76
if ((null == l3a ) && group .getKey ().equals (PilotOptions .LVL3_ADVANTAGES )) {
73
77
l3a = group ;
@@ -102,6 +106,7 @@ public void initialize() {
102
106
addOption (l3a , TECH_ENGINEER , false );
103
107
addOption (l3a , TECH_FIXER , false );
104
108
addOption (l3a , TECH_MAINTAINER , false );
109
+ addOption (l3a , FLAW_GLASS_JAW , false );
105
110
106
111
addOption (edge , EDGE_MEDICAL , true );
107
112
addOption (edge , EDGE_REPAIR_BREAK_PART , true );
@@ -122,8 +127,8 @@ public void initialize() {
122
127
break ;
123
128
default :
124
129
throw new IllegalStateException (
125
- "Unexpected value in mekhq/campaign/personnel/PersonnelOptions.java/initialize: "
126
- + option .getGroup ());
130
+ "Unexpected value in mekhq/campaign/personnel/PersonnelOptions.java/initialize: " +
131
+ option .getGroup ());
127
132
}
128
133
}
129
134
}
@@ -143,7 +148,7 @@ protected void addOption(IBasicOptionGroup group, String name, int type, Object
143
148
* Returns the options of the given category that this pilot has
144
149
*/
145
150
public Enumeration <IOption > getOptions (String grpKey ) {
146
- for (Enumeration <IOptionGroup > i = getGroups (); i .hasMoreElements ();) {
151
+ for (Enumeration <IOptionGroup > i = getGroups (); i .hasMoreElements (); ) {
147
152
IOptionGroup group = i .nextElement ();
148
153
149
154
if (group .getKey ().equalsIgnoreCase (grpKey )) {
@@ -165,7 +170,7 @@ public void acquireAbility(final String type, final String name, final @Nullable
165
170
if (null != spa ) {
166
171
toRemove = spa .getRemovedAbilities ();
167
172
}
168
- for (Enumeration <IOption > i = getOptions (type ); i .hasMoreElements ();) {
173
+ for (Enumeration <IOption > i = getOptions (type ); i .hasMoreElements (); ) {
169
174
IOption ability = i .nextElement ();
170
175
if (ability .getName ().equals (name )) {
171
176
ability .setValue (value );
@@ -185,11 +190,9 @@ protected AbstractOptionsInfo getOptionsInfoImp() {
185
190
}
186
191
187
192
/**
188
- * Custom IOptionsInfo class that allows adding additional options to the base
189
- * MegaMek
190
- * options before finalizing and also holds a hash of IOptionInfo objects for
191
- * the abilities
192
- * so we can provide names and descriptions for the MekHQ-specific options.
193
+ * Custom IOptionsInfo class that allows adding additional options to the base MegaMek options before finalizing and
194
+ * also holds a hash of IOptionInfo objects for the abilities so we can provide names and descriptions for the
195
+ * MekHQ-specific options.
193
196
*
194
197
* @author Neoancient
195
198
*/
@@ -224,11 +227,8 @@ private void setOptionInfo(String name) {
224
227
}
225
228
226
229
/**
227
- * Access to ability names and descriptions from <code>SpecialAbility</code> if
228
- * the ability
229
- * has an entry, otherwise checks for the ability the MM PilotOptions class. If
230
- * not found
231
- * in either place, returns the lookup key instead.
230
+ * Access to ability names and descriptions from <code>SpecialAbility</code> if the ability has an entry, otherwise
231
+ * checks for the ability the MM PilotOptions class. If not found in either place, returns the lookup key instead.
232
232
*
233
233
* @author Neoancient
234
234
*/
0 commit comments