Package networking.response

Examples of networking.response.ResponseChartBiomass


                        String csv = BiomassCSVDAO.getCSV(zone.getManipulationID());

                        if (csv != null) {
                            csv = csv.substring(0, csv.lastIndexOf("\n"));

                            ResponseChartBiomass responseChartBiomass = new ResponseChartBiomass();
                            responseChartBiomass.setType(type);
                            responseChartBiomass.setCSV(csv);

                            responses.add(responseChartBiomass);
                        }
                    }
                }
            }
        } else if (type == 1) {
            World world = client.getWorld();

            if (world != null) {
                for (Zone zone : world.getGameEngine().getZoneList()) {
                    if (zone.isEnable()) {
                        String csv = SpeciesCSVDAO.getCSV(zone.getManipulationID());

                        if (csv != null) {
                            csv = csv.substring(0, csv.lastIndexOf("\n"));

                            ResponseChartBiomass responseChartBiomass = new ResponseChartBiomass();
                            responseChartBiomass.setType(type);
                            responseChartBiomass.setCSV(csv);

                            responses.add(responseChartBiomass);
                        }
                    }
                }
            }
        } else if (type == 2) {
            World world = client.getWorld();

            if (world != null) {
                for (Zone zone : world.getGameEngine().getZoneList()) {
                    if (zone.isEnable()) {
                        String csv = ScoreCSVDAO.getCSV(zone.getID());

                        if (csv != null) {
                            ResponseChartBiomass responseChartBiomass = new ResponseChartBiomass();
                            responseChartBiomass.setType(type);
                            responseChartBiomass.setCSV(csv);

                            responses.add(responseChartBiomass);
                        }
                    }
                }
View Full Code Here


            String biomass_csv = GameServer.removeNodesFromCSV(csv);
            BiomassCSVDAO.createCSV(manipulationID, biomass_csv);

            biomass_csv = biomass_csv.substring(0, biomass_csv.lastIndexOf("\n"));

            ResponseChartBiomass responseChartBiomass = new ResponseChartBiomass();
            responseChartBiomass.setType((short) 0);
            responseChartBiomass.setCSV(biomass_csv);

            GameServer.getInstance().addResponseForUser(zone.getEnvironment().getOwnerID(), responseChartBiomass);
        } catch (Exception ex) {
            ex.printStackTrace();
            System.err.println(ex.getMessage());
        }

        try {
            String species_csv = GameServer.convertBiomassCSVtoSpeciesCSV(csv);
            SpeciesCSVDAO.createCSV(manipulationID, species_csv);

            species_csv = species_csv.substring(0, species_csv.lastIndexOf("\n"));

            ResponseChartBiomass responseChartBiomass = new ResponseChartBiomass();
            responseChartBiomass.setType((short) 1);
            responseChartBiomass.setCSV(species_csv);

            GameServer.getInstance().addResponseForUser(zone.getEnvironment().getOwnerID(), responseChartBiomass);
        } catch (Exception ex) {
            ex.printStackTrace();
            System.err.println(ex.getMessage());
View Full Code Here

        try {
            score_csv += "\n" + currentTimeStep + "," + environmentScore;
            ScoreCSVDAO.createCSV(zone_id, score_csv);

            ResponseChartBiomass responseChartBiomass = new ResponseChartBiomass();
            responseChartBiomass.setType((short) 2);
            responseChartBiomass.setCSV(score_csv);

            GameServer.getInstance().addResponseForUser(env.getOwnerID(), responseChartBiomass);
        } catch (SQLException ex) {
            System.out.println(ex.getMessage());
        }
View Full Code Here

TOP

Related Classes of networking.response.ResponseChartBiomass

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.