ThreatSourceLibaray/tools/Program.cs

75 lines
2.8 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 ThreatSource.Utils;
using ThreatSource.Jamming;
namespace ThreatSource.Tools
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("末敏子弹模拟程序启动...");
var simulator = new MissileSimulator();
// 添加目标
var targetId = simulator.AddTarget(new Vector3D(0, 0, 0));
// 发射导弹
simulator.LaunchMissile(targetId, new Vector3D(40, 400, 40));
// 启动模拟线程
var simulationThread = new Thread(simulator.Start);
simulationThread.Start();
// 等待用户输入命令
while (true)
{
Console.WriteLine("\n请输入命令help查看帮助");
var command = Console.ReadLine()?.ToLower();
switch (command)
{
case "help":
ShowHelp();
break;
case "ir":
simulator.ApplyJamming(JammingType.Infrared, 100, 5, new Vector3D(0, 0, 0));
break;
case "mw":
simulator.ApplyJamming(JammingType.MillimeterWave, 200, 5, new Vector3D(0, 0, 0));
break;
case "laser":
simulator.ApplyJamming(JammingType.Laser, 150, 5, new Vector3D(0, 0, 0));
break;
case "clear ir":
simulator.ClearJamming(JammingType.Infrared);
break;
case "clear mw":
simulator.ClearJamming(JammingType.MillimeterWave);
break;
case "clear laser":
simulator.ClearJamming(JammingType.Laser);
break;
case "exit":
simulator.Stop();
return;
default:
Console.WriteLine("未知命令请输入help查看帮助");
break;
}
}
}
static void ShowHelp()
{
Console.WriteLine("可用命令:");
Console.WriteLine(" help - 显示帮助信息");
Console.WriteLine(" ir - 应用红外干扰");
Console.WriteLine(" mw - 应用毫米波干扰");
Console.WriteLine(" laser - 应用激光干扰");
Console.WriteLine(" clear ir - 清除红外干扰");
Console.WriteLine(" clear mw - 清除毫米波干扰");
Console.WriteLine(" clear laser - 清除激光干扰");
Console.WriteLine(" exit - 退出程序");
}
}
}