// • ▌ ▄ ·.  ▄▄▄·  ▄▄ • ▪   ▄▄· ▄▄▄▄·  ▄▄▄·  ▐▄▄▄  ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀  █▪▀▀▀ ▀  ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀  ▀  ▀ ▀▀  █▪ ▀▀▀
//      Magicbane Emulator Project © 2013 - 2024
//                www.magicbane.com

package engine.wpak.data;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Objects;

public class Effect {
    public String effect_id;
    public String effect_name;
    public int icon;
    public HashSet<String> sources = new HashSet<>();
    public ArrayList<ModifierEntry> mods = new ArrayList<>();
    public ArrayList<ConditionEntry> conditions = new ArrayList<>();

    // Additional variables outside of tags or parsed
    // elsewhere from Effects.cfg

    public boolean isItemEffect;
    public boolean isSpireEffect;
    public boolean ignoreNoMod;
    public boolean dontSave;

    public String type;
    public int level;
    public String message;
    public int cycleDuration;
    public int cycleDelay;

    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        Effect effect = (Effect) o;
        return Objects.equals(effect_id, effect.effect_id);
    }

    @Override
    public int hashCode() {
        return effect_id.hashCode(); // Use only the id field for hashCode
    }
}
