diff --git a/src/engine/db/handlers/dbZoneHandler.java b/src/engine/db/handlers/dbZoneHandler.java index 64b5754f..ac948589 100644 --- a/src/engine/db/handlers/dbZoneHandler.java +++ b/src/engine/db/handlers/dbZoneHandler.java @@ -11,7 +11,9 @@ package engine.db.handlers; import engine.Enum; import engine.gameManager.DbManager; +import engine.gameManager.ZoneManager; import engine.objects.Zone; +import engine.objects.ZoneTemplate; import org.pmw.tinylog.Logger; import java.sql.Connection; @@ -66,6 +68,24 @@ public class dbZoneHandler extends dbHandlerBase { return zone; } + public void LOAD_ALL_ZONE_TEMPLATES() { + + try (Connection connection = DbManager.getConnection(); + PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_building_blueprint")) { + + ResultSet rs = preparedStatement.executeQuery(); + + while (rs.next()) { + ZoneTemplate zoneTemplate = new ZoneTemplate(rs); + ZoneManager._zone_templates.put(zoneTemplate.templateID, zoneTemplate); + } + + } catch (SQLException e) { + Logger.error(e); + } + + } + public boolean DELETE_ZONE(final Zone zone) { try (Connection connection = DbManager.getConnection();