ModelingDebug/Program.cs

96 lines
3.0 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.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 Main(string[] args)
{
Console.Title = "Tools";//设置窗口标题
// 设置控制台输出编码,以支持复杂字符
Console.OutputEncoding = Encoding.UTF8;
Console.Clear();
Console.CursorVisible = false;
// new MusicFrom();
_ = 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()
{
Console.Clear();
string[] str = ["抽卡", "搜索引擎", Music.title, "小龙快跑", "贪吃蛇", "铁锈助手(联机模块)[未开发]"];
var modeSwitch = new ModeSwitch("请选择你要执行的操作", str, (a) =>
{
switch (a)
{
case 0:
_ = new ChouKa();//抽卡
break;
case 1:
_ = new Mod();
break;
case 2:
_ = new Music();
// _ = new MusicFrom();
break;
case 3:
_ = new MinLong.Main();
break;
case 4:
_ = new Tanchishe.Main();
break;
case 5:
// _ = new Tanchishe.Main();
_ = new Program();
break;
}
}, "作者:MuQing\n使用语言:C#\n使用IDE:VS Code\n使用框架:.NET 8.0 \n测试运行平台:Windows11\n项目地址:https://git.coldmint.top/muqing/ModelingMusicForm.git");
}
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();
}
/// <summary>
/// 重置字符数组
/// </summary>
public static void ResetChars()
{
for (int i = 0; i < chars.GetLength(0); i++)
{
for (int j = 0; j < chars.GetLength(1); j++)
{
chars[i, j] = new Point();
}
}
}
}