updated ModifierEntry contructors

This commit is contained in:
2024-09-02 16:09:52 -05:00
parent e09bd9aae0
commit a5ccba2e27
68 changed files with 143 additions and 168 deletions
@@ -17,7 +17,7 @@ import engine.objects.AbstractWorldObject;
import engine.objects.Building;
import engine.objects.Item;
import engine.powers.EffectsBase;
import engine.wpak.data.EffectModifier;
import engine.wpak.data.ModifierEntry;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -40,25 +40,10 @@ public abstract class AbstractEffectModifier {
protected String string1;
protected String string2;
public AbstractEffectModifier(ResultSet rs) throws SQLException {
public AbstractEffectModifier(ResultSet rs){
this.UUID = rs.getInt("ID");
this.IDString = rs.getString("IDString");
this.effectType = rs.getString("modType");
this.modType = ModType.GetModType(this.effectType);
this.type = rs.getString("type").replace("\"", "");
this.sourceType = SourceType.GetSourceType(this.type.replace(" ", "").replace("-", ""));
this.minMod = rs.getFloat("minMod");
this.maxMod = rs.getFloat("maxMod");
this.percentMod = rs.getFloat("percentMod");
this.ramp = rs.getFloat("ramp");
this.useRampAdd = (rs.getInt("useRampAdd") == 1) ? true : false;
this.string1 = rs.getString("string1");
this.string2 = rs.getString("string2");
}
public AbstractEffectModifier(EffectModifier mod) {
public AbstractEffectModifier(ModifierEntry mod) {
this.IDString = mod.type.name();
this.effectType = mod.type.name();
@@ -67,7 +52,7 @@ public abstract class AbstractEffectModifier {
this.sourceType = SourceType.GetSourceType(this.type.replace(" ", "").replace("-", ""));
this.minMod = mod.min;
this.maxMod = mod.max;
this.percentMod = mod.scale;
this.percentMod = mod.value;
this.ramp = (float)mod.compoundCurveType.getValue();
this.useRampAdd = (float)mod.compoundCurveType.getValue() != 0;