Server.Mobiles.BaseCreature.FindMyName C# (CSharp) Method

FindMyName() public method

public FindMyName ( string str, bool bWithAll ) : bool
str string
bWithAll bool
return bool
        public bool FindMyName( string str, bool bWithAll )
        {
            int i, j;

            string name = this.Name;

            if( name == null || str.Length < name.Length )
                return false;

            string[] wordsString = str.Split(' ');
            string[] wordsName = name.Split(' ');

            for ( j=0 ; j < wordsName.Length; j++ )
            {
                string wordName = wordsName[j];

                bool bFound = false;
                for ( i=0 ; i < wordsString.Length; i++ )
                {
                    string word = wordsString[i];

                    if ( Insensitive.Equals( word, wordName ) )
                        bFound = true;

                    if ( bWithAll && Insensitive.Equals( word, "all" ) )
                        return true;
                }

                if ( !bFound )
                    return false;
            }

            return true;
        }
BaseCreature