mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-30 23:52:38 +00:00
40 lines
1.4 KiB
C#
40 lines
1.4 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Text;
|
|||
|
using System.IO;
|
|||
|
|
|||
|
namespace CodeImp.DoomBuilder.GZBuilder.Data {
|
|||
|
public class EngineInfo {
|
|||
|
public const string DEFAULT_ENGINE_NAME = "Engine with no name";
|
|||
|
|
|||
|
public string TestProgramName;
|
|||
|
public string TestProgram;
|
|||
|
public string TestParameters;
|
|||
|
public bool CustomParameters;
|
|||
|
public int TestSkill;
|
|||
|
public bool TestShortPaths;
|
|||
|
|
|||
|
public EngineInfo() {
|
|||
|
TestProgramName = DEFAULT_ENGINE_NAME;
|
|||
|
}
|
|||
|
|
|||
|
public EngineInfo(EngineInfo other) {
|
|||
|
TestProgramName = other.TestProgramName;
|
|||
|
TestProgram = other.TestProgram;
|
|||
|
TestParameters = other.TestParameters;
|
|||
|
CustomParameters = other.CustomParameters;
|
|||
|
TestSkill = other.TestSkill;
|
|||
|
TestShortPaths = other.TestShortPaths;
|
|||
|
}
|
|||
|
|
|||
|
public void CheckProgramName(bool forced) {
|
|||
|
if ((forced || TestProgramName == DEFAULT_ENGINE_NAME) && !String.IsNullOrEmpty(TestProgram)) {
|
|||
|
//get engine name from folder name
|
|||
|
string n = Path.GetDirectoryName(TestProgram);
|
|||
|
int pos = n.LastIndexOf(Path.DirectorySeparatorChar);
|
|||
|
TestProgramName = n.Substring(pos + 1, n.Length - pos - 1);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|