1
0
Files
libcmo21/Assets/BMapBindings/BMapSharp/BMapSharpTest/Cli.cs

54 lines
1.8 KiB
C#
Raw Normal View History

2026-02-06 20:33:22 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BMapSharpTest {
public class CliException : Exception {
public CliException() { }
public CliException(string message)
: base(message) { }
public CliException(string message, Exception inner)
: base(message, inner) { }
}
public class Cli {
public Cli() {
var filename = System.Environment.GetEnvironmentVariable("BMAP_FILE_NAME");
if (filename is null) {
throw new CliException("You must specify BMAP_FILE_NAME environment variable before running this test.");
}
this.FileName = filename;
var ballance_dir = System.Environment.GetEnvironmentVariable("BMAP_BALLANCE_DIR");
if (ballance_dir is null) {
throw new CliException("You must specify BMAP_BALLANCE_DIR environment variable before running this test.");
}
2026-02-08 11:38:48 +08:00
this.BallanceDir = ballance_dir;
2026-02-06 20:33:22 +08:00
var encodings = System.Environment.GetEnvironmentVariable("BMAP_ENCODINGS");
if (encodings is null) {
throw new CliException("You must specify BMAP_ENCODINGS environment variable before running this test.");
}
this.Encodings = encodings.Split(",");
}
/// <summary>
/// The path to the map for loading.
/// </summary>
public string FileName { get; private set; }
/// <summary>
/// The path to the Ballance directory for finding textures
/// </summary>
2026-02-08 11:38:48 +08:00
public string BallanceDir { get; private set; }
2026-02-06 20:33:22 +08:00
/// <summary>
/// The name of encodings used by BMap for loading map.
/// </summary>
public string[] Encodings { get; private set; }
}
}