Package worldManager.gameEngine

Examples of worldManager.gameEngine.WaterSource


                for (Zone zone : env.getZones()) {
                    packet.addBoolean(zone.isEnable());
                    packet.addShort16((short) zone.getID());
                    packet.addShort16((short) zone.getType());

                    WaterSource waterSource = zone.getWaterSource();
                    packet.addBoolean(waterSource != null);

                    if (waterSource != null) {
                        packet.addInt32(waterSource.getID());
                        packet.addInt32(waterSource.getMaxWater());
                        packet.addInt32(waterSource.getWater());
                    }
                }
            }
        }
View Full Code Here


            System.out.println("x:" + x);
            System.out.println("y:" + y);
            System.out.println("z:" + z);


            WaterSource ws = new WaterSource(-1);
            ws.setPos(x, y, z);
            ws.setZoneID(zoneID);
            waters.add(ws);
        }

        System.out.println("*rts*******");
        for (WaterSource ws : waters) {
            ws.toString();
        }
        System.out.println("*******RequestWawterSource---Parse Ends*******");
    }
View Full Code Here

                //Get this WaterSource from database just for its id.
                try {
                    List<WaterSource> sameWSList = WaterSourceDAO.getByZoneID(ws.getZoneID());
                    if (sameWSList != null) {
                        WaterSource sameWS = sameWSList.get(0);//Each zone only has one water source.
                        if (sameWS != null) {
                            Zone zone = currentEnv.getZoneByID(sameWS.getZoneID());
                            if (zone != null) {
//                                zone.getWaters().add(sameWS);
                            }
                        }
                    }
View Full Code Here

            pstmt = connection.prepareStatement(query);
            pstmt.setInt(1, zone_id);
            ResultSet rs = pstmt.executeQuery();

            while (rs.next()) {
                WaterSource waterSource = new WaterSource(rs.getInt("water_source_id"));
                waterSource.setWater(rs.getInt("water"));
                waterSource.setMaxWater(rs.getInt("max_water"));
                waterSource.setRadius(rs.getInt("water_radius"));
                waterSource.setX(rs.getFloat("location_x"));
                waterSource.setY(rs.getFloat("location_y"));
                waterSource.setZ(rs.getFloat("location_z"));
                waterSource.setZoneID(rs.getInt("zone_id"));
                waterSourceList.add(waterSource);
            }

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

        for (Zone zone : env.getZones()) {
            packet.addShort16((short) zone.getID());
            packet.addShort16((short) zone.getType());

            WaterSource waterSource = zone.getWaterSource();
            packet.addBoolean(waterSource != null);

            if (waterSource != null) {
                packet.addInt32(waterSource.getID());
                packet.addInt32(waterSource.getMaxWater());
                packet.addInt32(waterSource.getWater());
            }
        }

        return packet.getBytes();
    }
View Full Code Here

                                zone.setParameters(ParamTableDAO.getByZoneID(zone_id));

                                ZoneType zoneType = ZoneTypeDAO.getZoneType(zone.getType());

                                if (zoneType.containsWater()) {
                                    WaterSource waterSource = new WaterSource(-1);
                                    waterSource.setMaxWater(100);
                                    waterSource.setWater(100);
                                    waterSource.setZoneID(zone_id);

                                    int water_source_id = WaterSourceDAO.createWaterSource(waterSource);
                                    waterSource.setID(water_source_id);

                                    zone.setWaterSource(waterSource);
                                }

                                env.setZone(zone);
View Full Code Here

TOP

Related Classes of worldManager.gameEngine.WaterSource

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.