public IEnumerator <MapComponents> GetEnumerator()
        {
            IEntry        lastEntry  = null;
            bool          makingMap  = false;
            MapComponents components = new MapComponents(mapName);

            foreach (IEntry entry in wad)
            {
                bool isMapEntry = IsMapEntry(entry.Path.Name);

                if (makingMap)
                {
                    if (isMapEntry)
                    {
                        components.Track(entry);
                    }
                    else
                    {
                        makingMap = false;

                        if (components.IsValid())
                        {
                            yield return(components);
                        }

                        components  = new MapComponents(mapName);
                        glLevelName = "";
                    }
                }
                else if (isMapEntry)
                {
                    if (lastEntry != null)
                    {
                        glLevelName = $"GL_{lastEntry.Path.Name}";

                        // This is a way of checking if our 'hacky override' to
                        // support external map naming should be done or not. If
                        // there is no level name to override (empty string for the
                        // name) then we know we should use the marker name.
                        if (mapName.Empty)
                        {
                            components = new MapComponents(lastEntry.Path.Name);
                        }
                    }

                    // It is the case that we could have a map with no marker
                    // entry at the beginning. Such a case is a malformed map
                    // and the builder will know what to do here if the last
                    // entry is null.
                    components.TrackMapMarker(lastEntry);
                    components.Track(entry);
                    makingMap = true;
                }

                lastEntry = entry;
            }

            // If we run out of entries but have a map that is potentially done
            // yet not processed, return it.
            if (components.IsValid())
            {
                yield return(components);
            }
        }