Refactored out duplicate resource type.
This commit is contained in:
@@ -12,7 +12,6 @@ import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.objects.Mine;
|
||||
import engine.objects.MineProduction;
|
||||
import engine.objects.Resource;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.Connection;
|
||||
@@ -84,7 +83,7 @@ public class dbMineHandler extends dbHandlerBase {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean CHANGE_RESOURCE(Mine mine, Resource resource) {
|
||||
public boolean CHANGE_RESOURCE(Mine mine, Enum.ResourceType resource) {
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_mine` SET `mine_resource`=? WHERE `UID`=?")) {
|
||||
|
||||
@@ -9,12 +9,16 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.ProtectionState;
|
||||
import engine.Enum.TransactionType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.*;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Transaction;
|
||||
import engine.objects.Warehouse;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.joda.time.DateTime;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -487,7 +491,7 @@ public class dbWarehouseHandler extends dbHandlerBase {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean CREATE_TRANSACTION(int warehouseBuildingID, GameObjectType targetType, int targetUUID, TransactionType transactionType, Resource resource, int amount, DateTime date) {
|
||||
public boolean CREATE_TRANSACTION(int warehouseBuildingID, GameObjectType targetType, int targetUUID, TransactionType transactionType, Enum.ResourceType resource, int amount, DateTime date) {
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_warehouse_transactions` (`warehouseUID`, `targetType`,`targetUID`, `type`,`resource`,`amount`,`date` ) VALUES (?,?,?,?,?,?,?)")) {
|
||||
|
||||
Reference in New Issue
Block a user