using RimWorld;
using System.Collections.Generic;
namespace RJWSexperience.Ideology
{
///
/// ThoughtDef using opinion
///
public class ThoughtDef_Opinionbased : ThoughtDef
{
public List minimumValueforStage = new List();
}
///
/// Thought class using record.
///
public class Thought_Opinionbased : Thought_Memory
{
protected ThoughtDef_Opinionbased Def => (ThoughtDef_Opinionbased)def;
protected List minimumValueforStage => Def.minimumValueforStage;
public override int CurStageIndex
{
get
{
float value = 0f;
if (otherPawn != null) value = pawn.relations?.OpinionOf(otherPawn) ?? 0f;
for (int i = minimumValueforStage.Count - 1; i > 0; i--)
{
if (minimumValueforStage[i] < value) return i;
}
return 0;
}
}
}
}