public override bool Equals(Object o)
    {
        CreatureForm other   = (CreatureForm)o;
        bool         isEqual = true;

        isEqual &= creatureTypes.Count == other.creatureTypes.Count;
        foreach (CreatureType ct in creatureTypes)
        {
            isEqual &= other.creatureTypes.Contains(ct);
        }


        CreatureStats expectedStats = (new CreatureStats()).getStatsWithMods(statMods);
        CreatureStats actualStats   = (new CreatureStats()).getStatsWithMods(other.statMods);

        isEqual &= expectedStats.Equals(actualStats);
        isEqual &= (formAbility == null && other.formAbility == null) || formAbility.Equals(other.formAbility);
        isEqual &= (revealAction == null && other.revealAction == null) || revealAction.Equals(other.revealAction);
        isEqual &= (signature == null && other.signature == null) || signature.Equals(other.signature);
        return(isEqual);
    }
Пример #2
0
    public override bool Equals(Object obj)
    {
        if (!(obj is FocusPoint))
        {
            return(false);
        }
        FocusPoint other = (FocusPoint)obj;

        bool isEqual = true;

        if (!(statModifiers == null && other.statModifiers == null))
        {
            isEqual &= statModifiers.Count == other.statModifiers.Count;
            isEqual &= (new CreatureStats()).getStatsWithMods(statModifiers).Equals((new CreatureStats()).getStatsWithMods(other.statModifiers));
        }

        isEqual &= (battleAction == null && other.battleAction == null) || battleAction.Equals(other.battleAction);
        isEqual &= (focusTrigger == null && other.focusTrigger == null) || focusTrigger.Equals(other.focusTrigger);

        return(isEqual);
    }