using Verse;
using Verse.AI;
using Verse.AI.Group;
using RimWorld;

namespace SCE
{
    public class JobGiver_MarryLewdIdle : ThinkNode_JobGiver
    {
        protected override Job TryGiveJob(Pawn pawn)
        {
            var ritual = pawn.GetLord()?.LordJob as LordJob_Ritual;
            if (ritual == null)
            {
                return null;
            }

            TargetInfo partner = ritual.SecondFocusForStage(ritual.StageIndex, pawn);
            if (partner == null)
            {
                return null;
            }
            return JobMaker.MakeJob(SCEJobDefOf.MarryLewdIdle, (LocalTargetInfo) partner);
        }
    }
}