@Nullable private WakfuEffect findEffectWithActionId(final int actionId) { for (int i = 0, size = this.m_effects.size(); i < size; ++i) { final WakfuEffect effect = this.m_effects.get(i); if (effect.getActionId() == actionId) { return effect; } } return null; }
private void computeEffects(final Iterator<WakfuEffect> it) { while (it.hasNext()) { final WakfuEffect effect = it.next(); if (this.isMergeable(effect)) { final WakfuEffect wakfuEffect = this.findEffectWithActionId(effect.getActionId()); if (wakfuEffect != null) { final float[] toAddParams = effect.getRawParams(); final float[] sourceParams = wakfuEffect.getRawParams(); for (int i = 0, size = sourceParams.length; i < size; i += 2) { final float[] array = sourceParams; final int n = i; array[n] += toAddParams[i]; } } else { this.m_effects.add(effect.clone()); } } else { this.m_effects.add(effect); } } }