use of eidolons.libgdx.anims.std.SpellAnim.SPELL_ANIMS in project Eidolons by IDemiurge.
the class AnimMultiplicator method filterCoordinates.
private Collection<Coordinates> filterCoordinates(SPELL_ANIMS template, Set<Coordinates> coordinates) {
if (template != null) {
FACING_DIRECTION facing = getActive().getOwnerObj().getFacing();
List<Coordinates> filtered = new ArrayList<>(coordinates);
Coordinates farthest = CoordinatesMaster.getFarmostCoordinateInDirection(facing.getDirection(), new ArrayList<>(coordinates), null);
switch(template) {
// template.getNumberOfEmitters(getActive())
case RAY:
anim.setForcedDestinationForAll(farthest);
return Arrays.asList(farthest);
case BLAST:
break;
case WAVE:
case SPRAY:
{
boolean xOrY = !facing.isVertical();
filtered.removeIf(c -> farthest.getXorY(xOrY) != c.getXorY(xOrY));
while (filtered.size() < template.getNumberOfEmitters(getActive())) {
List<Coordinates> list = new ArrayList<>(coordinates);
list.removeAll(filtered);
list.removeIf(c -> farthest.getXorY(!xOrY) == c.getXorY(!xOrY));
Coordinates c = CoordinatesMaster.getFarmostCoordinateInDirection(facing.getDirection(), list, null);
if (c != null)
filtered.add(c);
}
if (ListMaster.isNotEmpty(filtered))
return filtered;
else
return coordinates;
}
case RING:
break;
case NOVA:
break;
}
}
return coordinates;
}
Aggregations