rjw-sexperience-ideology/Source/IdeologyAddon/HistoryEvents/TwoPawnEventRule.cs
2022-11-21 22:40:44 +05:00

22 lines
673 B
C#

using RimWorld;
using RJWSexperience.Ideology.Filters;
using System.Diagnostics.CodeAnalysis;
using Verse;
namespace RJWSexperience.Ideology.HistoryEvents
{
/// <summary>
/// Type to associate single HistoryEventDef with a TwoPawnFilter
/// </summary>
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Def loader")]
public class TwoPawnEventRule
{
public HistoryEventDef historyEventDef;
public TwoPawnFilter filter;
/// <summary>
/// Check if the pair of pawns fits filter conditions
/// </summary>
public bool Applies(Pawn pawn, Pawn partner) => filter?.Applies(pawn, partner) == true;
}
}