rjw-sexperience-ideology/Source/IdeologyAddon/Thoughts/ThoughtDefExtension_StageFr...

34 lines
925 B
C#

using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Verse;
namespace RJWSexperience
{
public class ThoughtDefExtension_StageFromOpinion : DefModExtension
{
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public List<float> minimumValueforStage = new List<float>();
public override IEnumerable<string> ConfigErrors()
{
foreach (string error in base.ConfigErrors())
{
yield return error;
}
if (minimumValueforStage.NullOrEmpty())
{
yield return "<minimumValueforStage> should have an entry for every stage";
}
for (int i = 0; i < minimumValueforStage.Count - 1; i++)
{
if (minimumValueforStage[i] > minimumValueforStage[i + 1])
{
yield return "Values in <minimumValueforStage> should be ordered from the lowest to the highest";
}
}
}
}
}