using Verse;
using RimWorld;

namespace SCE
{
    public static class RitualExtensions
    {
        public static bool IsFor(this RitualObligation obligation, Thing first, Thing second)
        {
            return (obligation.targetA == first && obligation.targetB == second) || (obligation.targetA == second && obligation.targetB == first);
        }

        public static bool IsFor(this RitualObligation obligation, Thing first, Thing second, Thing third)
        {
            if (obligation.targetC == first)
            {
                return obligation.IsFor(second, third);
            }
            if (obligation.targetC == second)
            {
                return obligation.IsFor(first, third);
            }
            if (obligation.targetC == third)
            {
                return obligation.IsFor(first, second);
            }
            return false;
        }
        
        public static string OrNull(this string s) => s ?? "null";
    }
}