forked from MagicBane/Server
Enum equals faster than string contains
This commit is contained in:
@@ -2222,8 +2222,8 @@ public class mbEnums {
|
|||||||
SIVL0243(0.243f, ADD),
|
SIVL0243(0.243f, ADD),
|
||||||
SIVL0360(0.360f, ADD);
|
SIVL0360(0.360f, ADD);
|
||||||
|
|
||||||
private final float value;
|
public final float value;
|
||||||
private final ModificationType type;
|
public final ModificationType type;
|
||||||
|
|
||||||
CompoundCurveType(float value, ModificationType type) {
|
CompoundCurveType(float value, ModificationType type) {
|
||||||
|
|
||||||
|
|||||||
@@ -436,12 +436,12 @@ public class WpakPowerManager {
|
|||||||
// These all have "SIVL" in the curve name suggesting
|
// These all have "SIVL" in the curve name suggesting
|
||||||
// interpolation between min max. Not something currently done.
|
// interpolation between min max. Not something currently done.
|
||||||
|
|
||||||
outData.first = modifierEntry.compoundCurveType.name().contains("SIVL") ?
|
outData.first = modifierEntry.compoundCurveType.type.equals(mbEnums.ModificationType.MULTIPLY) ?
|
||||||
modifierEntry.min * (1 + (modifierEntry.compoundCurveType.getValue() * rank)) :
|
modifierEntry.min * (1 + (modifierEntry.compoundCurveType.getValue() * rank)) :
|
||||||
modifierEntry.min + (modifierEntry.compoundCurveType.getValue() * rank);
|
modifierEntry.min + (modifierEntry.compoundCurveType.getValue() * rank);
|
||||||
|
|
||||||
if (modifierEntry.max != 0)
|
if (modifierEntry.max != 0)
|
||||||
outData.second = modifierEntry.compoundCurveType.name().contains("SIVL") ?
|
outData.second = modifierEntry.compoundCurveType.type.equals(mbEnums.ModificationType.MULTIPLY) ?
|
||||||
modifierEntry.max * (1 + (modifierEntry.compoundCurveType.getValue() * rank)) :
|
modifierEntry.max * (1 + (modifierEntry.compoundCurveType.getValue() * rank)) :
|
||||||
modifierEntry.max + (modifierEntry.compoundCurveType.getValue() * rank);
|
modifierEntry.max + (modifierEntry.compoundCurveType.getValue() * rank);
|
||||||
return outData;
|
return outData;
|
||||||
|
|||||||
Reference in New Issue
Block a user