Examples of IOption


Examples of megamek.common.options.IOption

        GameOptionsDialog god = new GameOptionsDialog(frame, g.getOptions());
        god.update(g.getOptions());
        god.setEditable(true);
        god.setVisible(true);
        for (IBasicOption opt : god.getOptions()) {
            IOption orig = g.getOptions().getOption(opt.getName());
            orig.setValue(opt.getValue());
        }
        god = null;

        // get player types and colors set
        Player[] pa = new Player[g.getPlayersVector().size()];
View Full Code Here

Examples of megamek.common.options.IOption

        StringTokenizer st = new StringTokenizer(adv);

        while (st.hasMoreTokens()) {
            String curAdv = st.nextToken();

            IOption option = entity.getCrew().getOptions().getOption(curAdv);

            if (null == option) {
                System.out.println("Ignoring invalid pilot advantage: "
                        + curAdv);
            } else {
                System.out.println("Adding pilot advantage '" + curAdv
                        + "' to " + entity.getDisplayName());
                option.setValue(true);
            }
        }
    }
View Full Code Here

Examples of megamek.common.options.IOption

        int changed = 0;

        for (Enumeration<?> i = ((Vector<?>) packet.getObject(1)).elements(); i.hasMoreElements();) {
            IBasicOption option = (IBasicOption) i.nextElement();
            IOption originalOption = game.getOptions().getOption(option.getName());

            if (originalOption == null) {
                continue;
            }

            StringBuffer message = new StringBuffer();
            message.append("Player ").append(player.getName()).append(" changed option \"").append(originalOption.getDisplayableName()).append("\" to ").append(option.getValue().toString()).append('.');
            sendServerChat(message.toString());
            originalOption.setValue(option.getValue());
            changed++;
        }

        // Set proper RNG
        Compute.setRNG(game.getOptions().intOption("rng_type"));
View Full Code Here

Examples of megamek.common.options.IOption

     */
    private void receiveGameOptionsAux(Packet packet, int connId) {

        for (Enumeration<?> i = ((Vector<?>) packet.getObject(1)).elements(); i.hasMoreElements();) {
            IBasicOption option = (IBasicOption) i.nextElement();
            IOption originalOption = game.getOptions().getOption(option.getName());
            if (originalOption != null) {
                if ("maps_include_subdir".equals(originalOption.getName())) {
                    mapSettings.setBoardsAvailableVector(scanForBoards(mapSettings.getBoardWidth(), mapSettings.getBoardHeight()));
                    mapSettings.removeUnavailable();
                    mapSettings.setNullBoards(DEFAULT_BOARD);
                    send(createMapSettingsPacket());
                }
View Full Code Here

Examples of megamek.common.options.IOption

        GameOptionsDialog god = new GameOptionsDialog(frame, g.getOptions());
        god.update(g.getOptions());
        god.setEditable(true);
        god.setVisible(true);
        for (IBasicOption opt : god.getOptions()) {
            IOption orig = g.getOptions().getOption(opt.getName());
            orig.setValue(opt.getValue());
        }
        god = null;

        // get player types and colors set
        Player[] pa = new Player[g.getPlayersVector().size()];
View Full Code Here

Examples of megamek.common.options.IOption

        }
        if ((en.crew.countAdvantages() > 0) || (en.crew.countMDImplants() > 0)) {
            int i = 0;
            for (Enumeration<IOption> advantages = en.crew.getAdvantages(); advantages
                    .hasMoreElements();) {
                IOption option = advantages.nextElement();
                if (option.booleanValue()) {
                    advantagesR[i++].setString(option
                            .getDisplayableNameWithValue());
                }
            }
            for (Enumeration<IOption> implants = en.crew.getMDImplants(); implants
                    .hasMoreElements();) {
                IOption option = implants.nextElement();
                if (option.booleanValue()) {
                    advantagesR[i++].setString(option
                            .getDisplayableNameWithValue());
                }
            }
        }
View Full Code Here

Examples of megamek.common.options.IOption

        }
        if (en.crew.countAdvantages() > 0) {
            int i = 0;
            for (Enumeration<IOption> advantages = en.crew.getAdvantages(); advantages
                    .hasMoreElements();) {
                IOption option = advantages.nextElement();
                if (option.booleanValue()) {
                    advantagesR[i++].setString(option
                            .getDisplayableNameWithValue());
                }
            }
        }
View Full Code Here

Examples of megamek.common.options.IOption

            if (!group.getKey().equalsIgnoreCase(PilotOptions.LVL3_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.LVL3_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

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

        for (Enumeration<IOption> j = getAdvantages(); 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
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.