fCraft.WorldManager.FindWorldsNoEvent C# (CSharp) Method

FindWorldsNoEvent() public static method

Finds all worlds that match the given world name. Autocompletes. Does not raise SearchingForWorld event. Target worlds are not guaranteed to have a loaded map.
public static FindWorldsNoEvent ( [ name ) : fCraft.World[]
name [
return fCraft.World[]
        public static World[] FindWorldsNoEvent( [NotNull] string name )
        {
            if ( name == null )
                throw new ArgumentNullException( "name" );
            World[] worldListCache = Worlds;

            List<World> results = new List<World>();
            for ( int i = 0; i < worldListCache.Length; i++ ) {
                if ( worldListCache[i] != null ) {
                    if ( worldListCache[i].Name.Equals( name, StringComparison.OrdinalIgnoreCase ) ) {
                        results.Clear();
                        results.Add( worldListCache[i] );
                        break;
                    } else if ( worldListCache[i].Name.StartsWith( name, StringComparison.OrdinalIgnoreCase ) ) {
                        results.Add( worldListCache[i] );
                    }
                }
            }
            return results.ToArray();
        }