public static Effect buildEffect(EffectDescription description, Location heroLocation) { switch (description.type) { case EffectType.Explosion: return buildExplosion(description, heroLocation); } return null; }
private static Explosion buildExplosion(EffectDescription description, Location heroLocation) { Location location = description.startLocation; location.x -= heroLocation.x; location.y -= heroLocation.y; location.x *= LevelView.TILE_SIZE; location.y *= LevelView.TILE_SIZE; Explosion explosion = new Explosion(location); return explosion; }
public void queueEffect(EffectDescription effect) { _effectQueue.AddFirst(effect); }