public static int LevelOfTension(Pawn pawn, Pawn other)
 {
     /*List<Thought_Memory> memories = pawn.needs.mood.thoughts.memories.Memories;
      * int count = 0;
      * for (int i = 0; i < memories.Count(); i++)
      * {
      *  if (GRThoughtUtility.IsTensionMemory(memories[i].def) && memories[i].otherPawn == other)
      *  {
      *      count++;
      *  }
      * }*/
     return(GRThoughtUtility.NumOfMemoriesOfDefWhereOtherPawnIs(pawn, other, ThoughtDefOfGR.SexualTension) + GRThoughtUtility.NumOfMemoriesOfDefWhereOtherPawnIs(pawn, other, ThoughtDefOfGR.RomanticTension) + GRThoughtUtility.NumOfMemoriesOfDefWhereOtherPawnIs(pawn, other, ThoughtDefOfGR.LogicalTension));
 }
        public static bool RelationshipCanEvolveTo(Pawn pawn, Pawn other, PawnRelationDef newRelation)
        {
            List <ThoughtCondition> conditions;

            try
            {
                conditions = newRelation.GetModExtension <RomanticRelationExtension>().conditions;
            }
            catch (NullReferenceException)
            {
                return(false);
            }
            if (conditions.NullOrEmpty())
            {
                return(false);
            }
            if (!AttractionUtility.IsAgeAppropriate(pawn) || !AttractionUtility.IsAgeAppropriate(other))
            {
                try
                {
                    if (newRelation.GetModExtension <RomanticRelationExtension>().doesLovin)
                    {
                        return(false);
                    }
                }
                catch (NullReferenceException)
                {
                    return(false);
                }
            }
            for (int i = 0; i < conditions.Count(); i++)
            {
                Log.Message(conditions[i].thought.defName + ": " + pawn.needs.mood.thoughts.memories.NumMemoriesOfDef(conditions[i].thought).ToString() + " " + other.needs.mood.thoughts.memories.NumMemoriesOfDef(conditions[i].thought) + " needs " + conditions[i].numberRequired.ToString());

                if (GRThoughtUtility.NumOfMemoriesOfDefWhereOtherPawnIs(pawn, other, conditions[i].thought) < conditions[i].numberRequired || GRThoughtUtility.NumOfMemoriesOfDefWhereOtherPawnIs(other, pawn, conditions[i].thought) < conditions[i].numberRequired)
                {
                    return(false);
                }
            }
            return(true);
        }
 public static int LevelOfSexualTension(Pawn pawn, Pawn other)
 {
     return(GRThoughtUtility.NumOfMemoriesOfDefWhereOtherPawnIs(pawn, other, ThoughtDefOfGR.SexualTension));
 }