27 lines
508 B
C#
27 lines
508 B
C#
using RimWorld;
|
|
using System.Collections.Generic;
|
|
using Verse;
|
|
|
|
namespace rjwquirks.Modules.Shared.PawnSelectors
|
|
{
|
|
public class HasBodyType : PawnSelector
|
|
{
|
|
public BodyTypeDef bodyType;
|
|
|
|
public override bool PawnSatisfies(Pawn pawn) => pawn.story?.bodyType == bodyType;
|
|
|
|
public override IEnumerable<string> ConfigErrors()
|
|
{
|
|
foreach (string error in base.ConfigErrors())
|
|
{
|
|
yield return error;
|
|
}
|
|
|
|
if (bodyType == null)
|
|
{
|
|
yield return "<bodyType> is empty";
|
|
}
|
|
}
|
|
}
|
|
}
|