Package com.jcloisterzone.config

Examples of com.jcloisterzone.config.Config


        game.getExpansions().add(Expansion.BASIC);
    }

    @Before
    public void initFactories() {
        Config config = new Config();
        game.setConfig(config);
        setUpGame(game);
        packFactory.setGame(game);
        packFactory.setConfig(config);
        tileFactory.setGame(game);
View Full Code Here


    protected EventCatchingGame createGame(String save) {
        try {
            URI uri = getClass().getResource(save).toURI();
            Snapshot snapshot = new Snapshot(new File(uri));
            EventCatchingGame game = (EventCatchingGame) snapshot.asGame(new EventCatchingGame());
            game.setConfig(new Config());
            LoadGamePhase phase = new LoadGamePhase(game, snapshot, null);
            game.getPhases().put(phase.getClass(), phase);
            game.setPhase(phase);
            phase.setSlots(new PlayerSlot[0]);
            phase.startGame();
View Full Code Here

        System.setProperty("apple.awt.graphics.EnableQ2DX", "true");
        System.setProperty("apple.laf.useScreenMenuBar", "true");
        System.setProperty("com.apple.mrj.application.apple.menu.about.name", "JCloisterZone");

        ConfigLoader configLoader = new ConfigLoader();
        Config config = configLoader.load();

        I18nUtils.setLocale(config.getLocaleObject()); //must be set before Expansions enum is initialized

        List<Plugin> plugins = loadPlugins(config);

        final Client client = new Client(configLoader, config, plugins);
View Full Code Here

            return new String[] {hp[0], client.getConfig().getPort() + ""};
        }
    }

    private void saveHistory() {
        Config cfg = client.getConfig();
        String record = hostField.getText().trim();
        String port = portField.getText().trim();
        if (!port.equals(client.getConfig().getPort() + "")) {
            record = record + ":" + port;
        }
        cfg.setConnection_history(Collections.singletonList(record));
        client.saveConfig();
    }
View Full Code Here

                    presets.addItem(profile); // TODO insert at
                } else { // profile already exists
                    profile = (Preset) item;
                    profile.setConfig(createCurrentConfig());
                }
                Config config = client.getConfig();
                config.getPresets().put(profile.getName(), profile.getConfig());
                client.saveConfig();
                updatePresetButtons(presets.getSelectedItem());
            }
        });
        presetPanel.add(presetSave, "width 80, gapright 10, west");

        presetDelete = new JButton(_("Delete"));
        presetDelete.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                Object item = presets.getSelectedItem();
                if (item instanceof String) {
                    item = getPresetFor((String) item);
                }
                if (item instanceof Preset) {
                    Preset preset = (Preset) item;
                    presets.removeItem(preset);
                    Config config = client.getConfig();
                    config.getPresets().remove(preset.getName());
                    client.saveConfig();
                    presets.setSelectedItem("");
                    updatePresetButtons("");
                }
            }
View Full Code Here

TOP

Related Classes of com.jcloisterzone.config.Config

Copyright © 2018 www.massapicom. 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.