|
|
@ -9,8 +9,14 @@ |
|
|
|
|
|
|
|
|
|
|
|
package engine.db.handlers; |
|
|
|
package engine.db.handlers; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import engine.gameManager.DbManager; |
|
|
|
import engine.objects.EffectsResourceCosts; |
|
|
|
import engine.objects.EffectsResourceCosts; |
|
|
|
|
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.sql.Connection; |
|
|
|
|
|
|
|
import java.sql.PreparedStatement; |
|
|
|
|
|
|
|
import java.sql.ResultSet; |
|
|
|
|
|
|
|
import java.sql.SQLException; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
|
|
|
|
public class dbEffectsResourceCostHandler extends dbHandlerBase { |
|
|
|
public class dbEffectsResourceCostHandler extends dbHandlerBase { |
|
|
@ -20,11 +26,22 @@ public class dbEffectsResourceCostHandler extends dbHandlerBase { |
|
|
|
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); |
|
|
|
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ArrayList<EffectsResourceCosts> GET_ALL_EFFECT_RESOURCES(String idString) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ArrayList<EffectsResourceCosts> effectsResourceCosts = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
public ArrayList<EffectsResourceCosts> GET_ALL_EFFECT_RESOURCES(String idString) { |
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
|
|
prepareCallable("SELECT * FROM `static_power_effectcost` WHERE `IDString` = ?"); |
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_power_effectcost` WHERE `IDString` = ?")) { |
|
|
|
setString(1, idString); |
|
|
|
|
|
|
|
return getObjectList(); |
|
|
|
preparedStatement.setString(1, idString); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ResultSet rs = preparedStatement.executeQuery(); |
|
|
|
|
|
|
|
effectsResourceCosts = getObjectsFromRs(rs, 1000); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (SQLException e) { |
|
|
|
|
|
|
|
Logger.error(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return effectsResourceCosts; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|