Added isBloodRelated filter attribute

This commit is contained in:
amevarashi 2022-11-21 22:40:44 +05:00
parent 765e6c0778
commit 7d6f0d043c
8 changed files with 92 additions and 142 deletions

View file

@ -1,16 +1,22 @@
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
{
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public HistoryEventDef historyEventDef;
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
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;
}
}