using Verse;
using RimWorld;
using HarmonyLib;

namespace SCE
{
    public class Thought_MemoryRelation : Thought_Memory
    {
        protected PawnRelationDef _relation;
        protected virtual PawnRelationDef Relation => pawn.GetMostImportantRelation(otherPawn);

        protected string RelationLabel
        {
            get
            {
                if (otherPawn == null)
                {
                    return "";
                }
                if (_relation == null)
                {
                    _relation = Relation;
                }
                return _relation?.GetGenderSpecificLabel(otherPawn) ?? "";
            }
        }

        public override string LabelCap => base.LabelCap.Replace(ReplaceTags.Relation, RelationLabel).CapitalizeFirst();

        public override string Description => base.Description.Replace(ReplaceTags.Relation, RelationLabel).CapitalizeFirst();
    }
}