Files
BattleBane/src/engine/db/handlers/dbHeightMapHandler.java
T

44 lines
1.2 KiB
Java
Raw Normal View History

2022-04-30 09:41:17 -04:00
package engine.db.handlers;
import engine.InterestManagement.HeightMap;
2023-05-21 08:36:39 -04:00
import engine.gameManager.DbManager;
2022-04-30 09:41:17 -04:00
import org.pmw.tinylog.Logger;
2023-05-21 08:36:39 -04:00
import java.sql.Connection;
import java.sql.PreparedStatement;
2022-04-30 09:41:17 -04:00
import java.sql.ResultSet;
import java.sql.SQLException;
public class dbHeightMapHandler extends dbHandlerBase {
2023-05-21 08:36:39 -04:00
public dbHeightMapHandler() {
2022-04-30 09:41:17 -04:00
2023-05-21 08:36:39 -04:00
}
2022-04-30 09:41:17 -04:00
2023-05-21 08:36:39 -04:00
public void LOAD_ALL_HEIGHTMAPS() {
2022-04-30 09:41:17 -04:00
2023-05-21 08:36:39 -04:00
HeightMap thisHeightmap;
HeightMap.heightMapsCreated = 0;
2022-04-30 09:41:17 -04:00
2023-05-21 08:36:39 -04:00
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_zone_heightmap INNER JOIN static_zone_size ON static_zone_size.loadNum = static_zone_heightmap.zoneLoadID")) {
2022-04-30 09:41:17 -04:00
2023-05-21 08:36:39 -04:00
ResultSet rs = preparedStatement.executeQuery();
2022-04-30 09:41:17 -04:00
2023-05-21 08:36:39 -04:00
while (rs.next()) {
thisHeightmap = new HeightMap(rs);
2022-04-30 09:41:17 -04:00
2023-05-21 08:36:39 -04:00
if (thisHeightmap.getHeightmapImage() == null) {
Logger.info("Imagemap for " + thisHeightmap.getHeightMapID() + " was null");
continue;
}
}
2022-04-30 09:41:17 -04:00
2023-05-21 08:36:39 -04:00
} catch (SQLException e) {
Logger.error(e);
}
}
2022-04-30 09:41:17 -04:00
}