Headless/ExportLevelCommand.cs
/// <summary>
/// Attempt to auto detect the width of a dream based on the name of the directory.
/// If it cannot auto-detect the width, it will return 0.
/// </summary>
/// <param name="inputPath">The directory containing the dream's LBD files.</param>
/// <returns>The auto-detected width, or -1 if unable to detect.</returns>
Attempt to auto detect the width of a dream based on the name of the directory.
If it cannot auto-detect the width, it will return 0.
Attempt to auto detect the width of a dream based on the name of the directory . If it cannot auto - detect the width it will return 0 .
protected int detectDreamWidth(string inputPath)
        {
            if (!inputPath.EndsWith(Path.DirectorySeparatorChar.ToString()))
            {
                inputPath += Path.DirectorySeparatorChar;
            }
            var dirName = Path.GetFileName(Path.GetDirectoryName(inputPath))?.ToLowerInvariant();
            if (dirName == null) return -1;
            if (_dreamWidthsByName.ContainsKey(dirName))
            {
                return _dreamWidthsByName[dirName];
            }
            return -1;
        }
protected int detectDreamWidth ( string inputPath ) { if ( ! inputPath . EndsWith ( Path . DirectorySeparatorChar . ToString ( ) ) ) { inputPath += Path . DirectorySeparatorChar ; } var dirName = Path . GetFileName ( Path . GetDirectoryName ( inputPath ) ) ? . ToLowerInvariant ( ) ; if ( dirName == null ) return - 1 ; if ( _dreamWidthsByName . ContainsKey ( dirName ) ) { return _dreamWidthsByName [ dirName ] ; } return - 1 ; }
Attempt to auto detect the width of a dream based on the name of the directory.
Attempt to auto detect the width of a dream based on the name of the directory .
The auto-detected width, or -1 if unable to detect.
The auto - detected width or - 1 if unable to detect .
inputPath
string
The directory containing the dream's LBD files.
The directory containing the dream ' s LBD files .