using Verse;
using RimWorld;

namespace SCE
{
    public abstract class RitualPosition_Conditional : RitualPosition
    {
        public RitualPosition position;
        public bool invert;

        public override PawnStagePosition GetCell(IntVec3 spot, Pawn p, LordJob_Ritual ritual)
        {
            return position.GetCell(spot, p, ritual);
        }

        public override bool CanUse(IntVec3 spot, Pawn p, LordJob_Ritual ritual)
        {
            return (invert ^ CanUseInt(spot, p, ritual)) && position.CanUse(spot, p, ritual);
        }

        public abstract bool CanUseInt(IntVec3 spot, Pawn p, LordJob_Ritual ritual);

        public override void ExposeData()
        {
            base.ExposeData();
            Scribe_Deep.Look(ref position, "position");
            Scribe_Values.Look(ref invert, "invert");
        }
    }
}