Package worldManager.gameEngine

Examples of worldManager.gameEngine.NatureControllerType


            connection = DAO.getDataSource().getConnection();
            pstmt = connection.prepareStatement(query);
            ResultSet rs = pstmt.executeQuery();

            while (rs.next()) {
                NatureControllerType holdNCT = new NatureControllerType(rs.getInt("nature_controller_id"));
                holdNCT.setEcosystemType(rs.getString("ecosystem_type"));
                holdNCT.setCloudyChance(rs.getFloat("cloudy_chance"));
                holdNCT.setAverageCloud(rs.getFloat("average_cloud"));
                holdNCT.setCloudRange(rs.getFloat("cloud_range"));
                holdNCT.setRainChance(rs.getFloat("rain_chance"));
                holdNCT.setAverageRain(rs.getFloat("average_rain"));
                holdNCT.setRainRange(rs.getFloat("rain_range"));
                holdNCT.setEvaporationRate(rs.getFloat("evaporation_rate"));
                returnNCT.add(holdNCT);
            }

            rs.close();
            pstmt.close();
View Full Code Here


     * nature_controller_id to the database.  Note NatureControllerType
     * contains DiseaseType.  If none found returns null.
     * @throws SQLException
     */
    public static NatureControllerType getByNatureControllerID(int nature_controller_id) throws SQLException {
        NatureControllerType returnNatureControllerType = null;

        String query = "SELECT * FROM `nature_controller` WHERE `nature_controller_id` = ?";

        Connection connection = null;
        PreparedStatement pstmt = null;

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

            if (rs.next()) {
                returnNatureControllerType = new NatureControllerType(rs.getInt("nature_controller_id"));
                returnNatureControllerType.setEcosystemType(rs.getString("ecosystem_type"));
                returnNatureControllerType.setCloudyChance(rs.getFloat("cloudy_chance"));
                returnNatureControllerType.setAverageCloud(rs.getFloat("average_cloud"));
                returnNatureControllerType.setCloudRange(rs.getFloat("cloud_range"));
                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;
            }
View Full Code Here

     * nature_controller_id to the database.  Note NatureControllerType
     * contains DiseaseType.  If none found returns null.
     * @throws SQLException
     */
    public static NatureControllerType getByWorldID(int world_id) throws SQLException {
        NatureControllerType returnNatureControllerType = null;

        String query = "SELECT * FROM `world` w JOIN `nature_controller` n ON w.`nature_controller_id` = n.`nature_controller_id` WHERE `world_id` = ?";

        Connection connection = null;
        PreparedStatement pstmt = null;

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

            if (rs.next()) {
                returnNatureControllerType = new NatureControllerType(rs.getInt("nature_controller_id"));
                returnNatureControllerType.setEcosystemType(rs.getString("ecosystem_type"));
                returnNatureControllerType.setCloudyChance(rs.getFloat("cloudy_chance"));
                returnNatureControllerType.setAverageCloud(rs.getFloat("average_cloud"));
                returnNatureControllerType.setCloudRange(rs.getFloat("cloud_range"));
                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;
            }
View Full Code Here

TOP

Related Classes of worldManager.gameEngine.NatureControllerType

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.