FluffyManager.Utilities_Livestock.Shearable C# (CSharp) Method

Shearable() public static method

public static Shearable ( this pawnKind ) : bool
pawnKind this
return bool
        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;
        }