using Verse;
using RimWorld;
using rjw.Modules.Interactions.Objects.Parts;

namespace rjw
{
	// Would be nice to call this just 'ISexPart', but ILewdablePart already exists and represents something similar but different.
	public interface ISexPartHediff
	{
		HediffDef_SexPart Def { get; }

		T GetComp<T>() where T : HediffComp;

		HediffWithComps AsHediff { get; }
	}

	public static class ISexPartHediffExtensions
	{
		public static HediffComp_SexPart GetPartComp(this ISexPartHediff partHediff) => partHediff.GetComp<HediffComp_SexPart>();

		public static Pawn GetOwner(this ISexPartHediff part) => part.AsHediff.pawn;
	}
}