Browse Source

Changed if/else tunnel to switch

pull/13/head
FatBoy-DOTC 3 years ago
parent
commit
c795238231
  1. 107
      src/engine/powers/poweractions/AbstractPowerAction.java

107
src/engine/powers/poweractions/AbstractPowerAction.java

@ -76,75 +76,108 @@ public abstract class AbstractPowerAction { @@ -76,75 +76,108 @@ public abstract class AbstractPowerAction {
int token = DbManager.hasher.SBStringHash(IDString);
//cache token, used for applying effects.
PowersManager.ActionTokenByIDString.put(IDString, token);
if (type.equals("ApplyEffect"))
apa = null;
switch (type)
{
default:
Logger.error("valid type not found for poweraction of ID" + rs.getInt("ID"));
break;
case "ApplyEffect":
apa = new ApplyEffectPowerAction(rs, effects);
else if (type.equals("ApplyEffects"))
break;
case "ApplyEffects":
apa = new ApplyEffectsPowerAction(rs, effects);
else if (type.equals("DeferredPower"))
break;
case "DeferredPower":
apa = new DeferredPowerPowerAction(rs, effects);
else if (type.equals("DamageOverTime"))
break;
case "DamageOverTime":
apa = new DamageOverTimePowerAction(rs, effects);
else if (type.equals("Peek"))
break;
case "Peek":
apa = new PeekPowerAction(rs);
else if (type.equals("Charm"))
break;
case "Charm":
apa = new CharmPowerAction(rs);
else if (type.equals("Fear"))
break;
case "Fear":
apa = new FearPowerAction(rs);
else if (type.equals("Confusion"))
break;
case "Confusion":
apa = new ConfusionPowerAction(rs);
else if (type.equals("RemoveEffect"))
break;
case "RemoveEffect":
apa = new RemoveEffectPowerAction(rs);
else if (type.equals("Track"))
break;
case "Track":
apa = new TrackPowerAction(rs, effects);
else if (type.equals("DirectDamage"))
break;
case "DirectDamage":
apa = new DirectDamagePowerAction(rs, effects);
else if (type.equals("Transform"))
break;
case "Transform":
apa = new TransformPowerAction(rs, effects);
else if (type.equals("CreateMob"))
break;
case "CreateMob":
apa = new CreateMobPowerAction(rs);
else if (type.equals("Invis"))
break;
case "Invis":
apa = new InvisPowerAction(rs, effects);
else if (type.equals("ClearNearbyAggro"))
break;
case "ClearNearbyAggro":
apa = new ClearNearbyAggroPowerAction(rs);
else if (type.equals("MobRecall"))
break;
case "MobRecall":
apa = new MobRecallPowerAction(rs);
else if (type.equals("SetItemFlag"))
break;
case "SetItemFlag":
apa = new SetItemFlagPowerAction(rs);
else if (type.equals("SimpleDamage"))
break;
case "SimpleDamage":
apa = new SimpleDamagePowerAction(rs);
else if (type.equals("TransferStatOT"))
break;
case "TransferStatOT":
apa = new TransferStatOTPowerAction(rs, effects);
else if (type.equals("TransferStat"))
break;
case "TransferStat":
apa = new TransferStatPowerAction(rs, effects);
else if (type.equals("Teleport"))
break;
case "Teleport":
apa = new TeleportPowerAction(rs);
else if (type.equals("TreeChoke"))
break;
case "TreeChoke":
apa = new TreeChokePowerAction(rs);
else if (type.equals("Block"))
break;
case "Block":
apa = new BlockPowerAction(rs);
else if (type.equals("Resurrect"))
break;
case "Resurrect":
apa = new ResurrectPowerAction(rs);
else if (type.equals("ClearAggro"))
break;
case "ClearAggro":
apa = new ClearAggroPowerAction(rs);
else if (type.equals("ClaimMine"))
break;
case "ClaimMine":
apa = new ClaimMinePowerAction(rs);
else if (type.equals("Recall"))
break;
case "Recall":
apa = new RecallPowerAction(rs);
else if (type.equals("SpireDisable"))
break;
case "SpireDisable":
apa = new SpireDisablePowerAction(rs);
else if (type.equals("Steal"))
break;
case "Steal":
apa = new StealPowerAction(rs);
else if (type.equals("Summon"))
break;
case "Summon":
apa = new SummonPowerAction(rs);
else if (type.equals("RunegateTeleport"))
apa = new RunegateTeleportPowerAction(rs);
else if (type.equals("RunegateTeleport"))
break;
case "RunegateTeleport":
apa = new RunegateTeleportPowerAction(rs);
else if (type.equals("OpenGate"))
break;
case "OpenGate":
apa = new OpenGatePowerAction(rs);
else {
Logger.error("valid type not found for poweraction of ID" + rs.getInt("ID"));
continue;
break;
}
powerActions.put(IDString, apa);
powerActionsByID.put(apa.UUID, apa);

Loading…
Cancel
Save