public static bool Shearable( this PawnKindDef pawnKind )
{
if ( pawnKind == null )
return false;
var ret = false;
if ( _shearablePawnkind.ContainsKey( pawnKind ) )
{
if ( _shearablePawnkind[pawnKind].TryGetValue( out ret ) )
{
return ret;
}
ret = pawnKind.race.comps.OfType<CompProperties_Shearable>().Any( cp => cp.woolDef != null );
_shearablePawnkind[pawnKind].Update( ret );
return ret;
}
ret = pawnKind.race.comps.OfType<CompProperties_Shearable>().Any( cp => cp.woolDef != null );
_shearablePawnkind.Add( pawnKind, new Utilities.CachedValue<bool>( ret, Int32.MaxValue ) );
return ret;
}