Examples of IOption


Examples of megamek.common.options.IOption

        if (null == sep) {
            sep = "";
        }

        for (Enumeration<IOption> j = getMDImplants(); j.hasMoreElements();) {
            IOption option = j.nextElement();

            if (option.booleanValue()) {
                if (adv.length() > 0) {
                    adv.append(sep);
                }

                adv.append(option.getName());
                if (option.getType() == IOption.STRING
                        || option.getType() == IOption.CHOICE
                        || option.getType() == IOption.INTEGER) {
                    adv.append(" ").append(option.stringValue());
                }
            }
        }

        return adv.toString();
View Full Code Here

Examples of megamek.common.options.IOption

            if (!group.getKey().equalsIgnoreCase(PilotOptions.MD_ADVANTAGES))
                continue;

            for (Enumeration<IOption> j = group.getOptions(); j
                    .hasMoreElements();) {
                IOption option = j.nextElement();

                option.clearValue();
            }
        }

    }
View Full Code Here

Examples of megamek.common.options.IOption

            if (!group.getKey().equalsIgnoreCase(PilotOptions.MD_ADVANTAGES))
                continue;

            for (Enumeration<IOption> j = group.getOptions(); j
                    .hasMoreElements();) {
                IOption option = j.nextElement();

                if (option.booleanValue())
                    count++;
            }
        }

        return count;
View Full Code Here

Examples of megamek.common.options.IOption

    public boolean hasEdgeRemaining() {
        return (getOptions().intOption("edge") > 0);
    }

    public void decreaseEdge() {
        IOption edgeOption = getOptions().getOption("edge");
        edgeOption.setValue((Integer) edgeOption.getValue() - 1);
    }
View Full Code Here

Examples of megamek.common.options.IOption

            addGroup(group);

            for (Enumeration<IOption> j = group.getOptions(); j
                    .hasMoreElements();) {
                IOption option = j.nextElement();

                addOption(option);
            }
        }
View Full Code Here

Examples of megamek.common.options.IOption

            m_vMines.elementAt(i).setEnabled(false);
        }
    }

    public void setOptions() {
        IOption option;
        for (DialogOptionComponent comp : optionComps) {
         option = comp.getOption();
         if ((comp.getValue() == Messages.getString("CustomMechDialog.None"))) { // NON
                                                                            // -
                                                                            // NLS
                                                                            // -
                                                                            // $1
        entity.getCrew().getOptions().getOption(option.getName())
                .setValue("None"); // NON-NLS-$1
         } else {
        entity.getCrew().getOptions().getOption(option.getName())
                .setValue(comp.getValue());
         }
      }
    }
View Full Code Here

Examples of megamek.common.options.IOption

         }
      }
    }

    public void resetOptions() {
        IOption option;
        for (DialogOptionComponent comp : optionComps) {
         option = comp.getOption();
         option.setValue(false);
         entity.getCrew().getOptions().getOption(option.getName()).setValue(
            comp.getValue());
      }
    }
View Full Code Here

Examples of megamek.common.options.IOption

            addGroup(group, gridbag, c);

            for (Enumeration<IOption> j = group.getOptions(); j
                    .hasMoreElements();) {
                IOption option = j.nextElement();
               
                if(entity instanceof GunEmplacement) {
                    continue;
                }
               
                // a bunch of stuf should get disabled for conv infantry
                if (((entity instanceof Infantry && !(entity instanceof BattleArmor)))
                        && (option.getName().equals("vdni")
                                || option.getName().equals("bvdni"))) {
                    continue;
                }
               
                //a bunch of stuff should get disabled for all but conventional infantry
                if(!(entity instanceof Infantry && !(entity instanceof BattleArmor))
                        && (option.getName().equals("grappler")
                                || option.getName().equals("pl_masc")
                                || option.getName().equals("cyber_eye_im")
                                || option.getName().equals("cyber_eye_tele"))) {
                    continue;
                }

                addOption(option, gridbag, c, editable);
            }
View Full Code Here

Examples of megamek.common.options.IOption

            m_vMines.get(i).setEnabled(false);
        }
    }

    private void setOptions() {
        IOption option;
        for (final Object newVar : optionComps) {
            DialogOptionComponent comp = (DialogOptionComponent) newVar;
            option = comp.getOption();
            if ((comp.getValue() == Messages.getString("CustomMechDialog.None"))) { // NON-NLS-$1
                entity.getCrew().getOptions().getOption(option.getName())
                        .setValue("None"); // NON-NLS-$1
            } else {
                entity.getCrew().getOptions().getOption(option.getName())
                        .setValue(comp.getValue());
            }
        }
    }
View Full Code Here

Examples of megamek.common.options.IOption

            addGroup(group, gridbag, c);

            for (Enumeration<IOption> j = group.getOptions(); j
                    .hasMoreElements();) {
                IOption option = j.nextElement();
               
                if(entity instanceof GunEmplacement) {
                    continue;
                }
               
                // a bunch of stuf should get disabled for conv infantry
                if (((entity instanceof Infantry && !(entity instanceof BattleArmor)))
                        && (option.getName().equals("vdni")
                                || option.getName().equals("bvdni"))) {
                    continue;
                }
               
                //a bunch of stuff should get disabled for all but conventional infantry
                if(!(entity instanceof Infantry && !(entity instanceof BattleArmor))
                        && (option.getName().equals("grappler")
                                || option.getName().equals("pl_masc")
                                || option.getName().equals("cyber_eye_im")
                                || option.getName().equals("cyber_eye_tele"))) {
                    continue;
                }

                addOption(option, gridbag, c, editable);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.