AssemblyTool/RecodeItConsole/Commands/CommandProcessor.cs

53 lines
1.4 KiB
C#
Raw Normal View History

2024-06-14 19:06:21 -04:00
using ReCodeIt.Utils;
2024-06-11 19:18:48 -04:00
2024-06-14 19:06:21 -04:00
namespace ReCodeIt.Commands
2024-06-11 19:18:48 -04:00
{
internal class CommandProcessor
{
public CommandProcessor()
{ }
public void CommandLoop()
{
ShowStartText();
while (true)
{
var input = Console.ReadLine();
ProcessCommand(input);
}
}
private void ProcessCommand(string command)
{
if (command == "remap" || command == "Remap")
{
2024-06-14 19:06:21 -04:00
var remapper = new ReMapper.ReCodeItRemapper();
2024-06-11 19:18:48 -04:00
2024-06-13 07:45:40 -04:00
Logger.ClearLog();
Console.Clear();
ShowStartText();
2024-06-12 00:05:59 -04:00
DataProvider.LoadMappingFile();
DataProvider.LoadAssemblyDefinition();
2024-06-11 19:18:48 -04:00
remapper.InitializeRemap();
}
2024-06-12 00:05:59 -04:00
if (command == "clear")
{
Console.Clear();
ShowStartText();
}
2024-06-11 19:18:48 -04:00
}
private void ShowStartText()
{
Logger.Log($"-----------------------------------------------------------------", ConsoleColor.Green);
Logger.Log($"Cj's Assembly Tool", ConsoleColor.Green);
Logger.Log($"Version 0.1.0", ConsoleColor.Green);
2024-06-12 00:05:59 -04:00
Logger.Log($"Available Commands: `remap` `clear`", ConsoleColor.Green);
2024-06-11 19:18:48 -04:00
Logger.Log($"-----------------------------------------------------------------", ConsoleColor.Green);
}
}
}