ModelingDebug/Program.cs
2024-08-30 14:48:22 +08:00

107 lines
3.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using Debug.ModelingMusic;
namespace Debug;
/// <summary>
/// 主程序入口 参考 https://blog.csdn.net/oscar999/article/details/141370223
/// 在VS Code的终端中使用dotnet build命令来编译项目。这将在项目目录中生成一个bin文件夹其中包含编译后的程序集。
/// 使用dotnet run命令来运行项目。这将编译项目如果尚未编译并运行编译后的程序。
/// </summary>
public class Program
{
public static void printf(object a)
{
Console.Write(a);
}
public static void printfLine(object a)
{
Console.WriteLine(a);
}
//开始计时
public static void Main(string[] args)
{
Console.Title = "Tools";//设置窗口标题
// 设置控制台输出编码,以支持复杂字符
Console.OutputEncoding = Encoding.UTF8;
//// 更改控制台窗口的大小
//Console.SetWindowSize(100, 100);
//// 设置控制台屏幕缓冲区的大小以适应窗口大小
//if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
//{
// Console.SetBufferSize(100, 100);
//}
// Get the handle of the console window
Console.Clear();
Console.CursorVisible = false;
_ = new Program();
}
//Y,X
public static readonly Point[,] chars = new Point[10, 50];
public static bool IsWhile = true;
public const char ShowChar = ' ';
public static Random random = new();
public Program()
{
// MinLong.Main.ResetChars();
// _ = new MinLong.Main();
// return;
string[] str = ["退出", "抽卡", "铁锈位置搜索引擎", "音乐调试", "小龙快跑"];
var modeSwitch = new ModeSwitch("请选择你要执行的操作:", str, (a) =>
{
switch (a)
{
case 0:
Environment.Exit(0);
break;
case 1:
_ = new ChouKa();
break;
case 2:
_ = new Mod();
break;
case 3:
_ = new Music();
break;
case 4:
_ = new MinLong.Main();
break;
default:
printfLine("还没有这个功能");
break;
}
});
}
public static void KeyEndThread()
{
new Thread(() =>
{
while (IsWhile)
{
ConsoleKeyInfo consoleKeyInfo = Console.ReadKey(true);
if (consoleKeyInfo.Key == ConsoleKey.Escape)
{
IsWhile = false;
Thread.Sleep(500);
Console.Clear();
Environment.Exit(0);
return;
}
Thread.Sleep(500);
}
// 等待用户按下任意键后退出
}).Start();
}
}