Package worldManager.gameEngine

Examples of worldManager.gameEngine.Disease


     * @param passedDiseaseType
     * @throws SQLException
     */
    public static void doBusiness(DiseaseType passedDiseaseType) throws SQLException {
        int disease_id = passedDiseaseType.getDiseaseTypeID();
        Disease holdDisease = new Disease(disease_id);
        //DiseaseDAO dd = new DiseaseDAO();
        //holdDisease = dd.getByDiseaseID(disease_id_pk);
        String diseaseType = holdDisease.getName();
        String description = holdDisease.getDescription();
        float infectChance = holdDisease.getInfectChance();
        float spreadChance = holdDisease.getSpreadChance();
        ArrayList<Integer> infectSpeciesList = new ArrayList<Integer>();
        //DiseaseInfectsAnimalDAO dia = new DiseaseInfectsAnimalDAO();
        //infectSpeciesList = (ArrayList)dia.getAnimalIDByDiseaseID(disease_id_pk);
        float deathRate = holdDisease.getDeathRate();
        float healChance = holdDisease.getHealChance();
        passedDiseaseType.setDiseaseType(diseaseType);
        passedDiseaseType.setDescription(description);
        passedDiseaseType.setInfectChance(infectChance);
        passedDiseaseType.setSpreadChance(spreadChance);
        passedDiseaseType.setInfectSpecies(infectSpeciesList);
View Full Code Here


                returnNatureControllerType.setRainChance(rs.getFloat("rain_chance"));
                returnNatureControllerType.setAverageRain(rs.getFloat("average_rain"));
                returnNatureControllerType.setRainRange(rs.getFloat("rain_range"));
                returnNatureControllerType.setEvaporationRate(rs.getFloat("evaporation_rate"));

                Disease holdDisease = DiseaseDAO.getByDiseaseID(rs.getInt("disease_id"));
                //...
                //Ask Nathan;
            }

            rs.close();
View Full Code Here

                returnNatureControllerType.setRainChance(rs.getFloat("rain_chance"));
                returnNatureControllerType.setAverageRain(rs.getFloat("average_rain"));
                returnNatureControllerType.setRainRange(rs.getFloat("rain_range"));
                returnNatureControllerType.setEvaporationRate(rs.getFloat("evaporation_rate"));

                Disease holdDisease = DiseaseDAO.getByDiseaseID(rs.getInt("disease_id"));
                //...
                //Ask Nathan;
            }

            rs.close();
View Full Code Here

     * @return Returns the Disease from database by matching disease_id.
     * If none found returns null.
     * @throws SQLException
     */
    public static Disease getByDiseaseID(int disease_id) throws SQLException {
        Disease returnDisease = null;

        String query = "SELECT * FROM disease WHERE disease_id = ?";

        Connection connection = null;
        PreparedStatement pstmt = null;

        try {
            connection = DAO.getDataSource().getConnection();
            pstmt = connection.prepareStatement(query);
            pstmt.setInt(1, disease_id);
            ResultSet rs = pstmt.executeQuery();

            if (rs.next()) {
                returnDisease = new Disease(rs.getInt("disease_id"));
                returnDisease.setName(rs.getString("name"));
                returnDisease.setDescription(rs.getString("description"));
                returnDisease.setInfectChance(rs.getFloat("infect_chance"));
                returnDisease.setSpreadChance(rs.getFloat("spread_chance"));
                returnDisease.setDeathRate(rs.getFloat("death_rate"));
                returnDisease.setHealChance(rs.getFloat("heal_chance"));
            }

            rs.close();
            pstmt.close();
        } catch (SQLException ex) {
View Full Code Here

TOP

Related Classes of worldManager.gameEngine.Disease

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.