Package eu.flatworld.cstrader.data

Examples of eu.flatworld.cstrader.data.System


                jtbPricelists.addTab(name, pp);
            }

            galaxyPricelistPanel.addPropertyChangeListener(this);

            System currentLocation = Config.getConfig().getCurrentLocation();
            for (eu.flatworld.cstrader.data.System system : eu.flatworld.cstrader.data.System.values()) {
                jcbCurrentLocation.addItem(system);
            }
            jcbCurrentLocation.setSelectedItem(currentLocation);
            if (Config.getConfig().getWeightLimit() != null) {
View Full Code Here


            Long rtp = (Long) jtRoutes.getValueAt(row, 4);
            cl += rtp;
            Config.getConfig().setCredits(cl);
            jtfCredits.setText("" + cl);
        }
        System newsys = r.getItemWanted().getLocation().getSystem();
        Config.getConfig().setCurrentLocation(newsys);
        jcbCurrentLocation.setSelectedItem(newsys);
        Long newsec = r.getItemWanted().getLocation().getSector();
        Config.getConfig().setSector(newsec);
        if (newsec != null) {
View Full Code Here

            l.setGrid(grd);
            Long sector = Long.parseLong(m.group(7));
            l.setSector(sector);
            // get system id (6) and cross check
            Integer sysid = Integer.parseInt(m.group(6));
            System system = System.findSystemById(sysid);
            l.setSystem(system);

            // NEW: stash coords in file.
            LocationProperty lp = locationsProperties.get(itemLine.getItem().getName());
            if (lp == null) {
                lp = new LocationProperty();
            }
            lp.setLocation(system, sector, grd);
            locationsProperties.put(itemLine.getItem().getName(), lp);

            itemLine.setLocation(l);
            if (itemLine.isForSale()) {
                newpls[system.ordinal()].getForSale().add(itemLine);
            } else {
                newpls[system.ordinal()].getWanted().add(itemLine);
            }
        }
        return newpls;
    }
View Full Code Here

            newpls[i] = new Pricelist();
            newpls[i].setSystem(System.values()[i]);
            newpls[i].setPricelistDate(new java.util.Date());
        }
        Pricelist curpl = null;
        System cursys = null;
        String regex1 = "(for sale|wanted) at (\\w+) system (planets|starbases)";
        Pattern pat1 = Pattern.compile(regex1, Pattern.MULTILINE | Pattern.CASE_INSENSITIVE);
        text = text.replace("\r", "");
        text = text.replace(",", "");
        text = text.replace("\t\t\t\t", "\t");
        text = text.replace("\t\t\t", "\t");
        text = text.replace("\t\t", "\t");
        text = text.replace("\t", " ");
        boolean forSale = false;
        boolean wanted = false;
        boolean planet = false;
        boolean starbase = false;
        java.lang.System.err.println(text);
        String rows[] = text.split("\n");
        for (String row : rows) {
            if (row.length() == 0) {
                continue;
            }
            //compatibility with internet explorer copy
            if (row.length() == 1) {
                continue;
            }
            if (row.toLowerCase().contains("item prices")) {
                continue;
            }
            if (row.toLowerCase().contains("adarian systemaltian systembasian")) {
                continue;
            }
            if (row.toLowerCase().contains("year")) {
                continue;
            }
            //end
            if (row.toLowerCase().contains("not looking to buy")) {
                forSale = false;
                wanted = false;
                continue;
            }
            if (row.toLowerCase().contains("have nothing to sell")) {
                forSale = false;
                wanted = false;
                continue;
            }
            Matcher m1 = pat1.matcher(row);
            if (m1.find()) {
                cursys = System.valueOf(m1.group(2));
                curpl = newpls[cursys.ordinal()];
            }
            if (row.toLowerCase().contains("for sale at")) {
                //if (!columns[0].toLowerCase().contains(galaxy.name().toLowerCase())) {
                //    throw new Exception("You have pasted a pricelist of a different galaxy.");
                //}
View Full Code Here

    public static Long getRouteTPTC(Route r, eu.flatworld.cstrader.data.System currentLocation, Long sector, Long grid, boolean singleHop) {
        return Math.round(r.getTotalProfit() * 1d / (getRouteTurns(r, currentLocation, sector, grid, singleHop)));
    }

    public static String buildTooltip(ItemLine item) {
        System sys = Config.getConfig().getCurrentLocation();
        Long sec = Config.getConfig().getSector();
        Long grd = Config.getConfig().getGrid();
        Long ls = Config.getConfig().getLightSpeed();
        Long hs = Config.getConfig().getHyperjumpSpeed();
        boolean hop = Config.getConfig().isSingleHop();
View Full Code Here

TOP

Related Classes of eu.flatworld.cstrader.data.System

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.