public override void Execute(string[] args) { if (args.Length < 1) { App.Logger.Log($"[ParseCommand] - Use: {Name} {Syntax}"); } else { string joined = string.Join(" ", args); if (File.Exists(joined)) { App.Logger.Log("[ParseCommand] - File found. Checking..."); ParseTool pTool = new ParseTool(joined); NPC.ParseType type = pTool.GetParseType(); switch (type) { case NPC.ParseType.NPC: App.Logger.Log("[ParseCommand] - Started parsing 'NPC'."); MainWindow.CurrentProject.data.characters.Add(pTool.ParseCharacter()); App.Logger.Log("[ParseCommand] - 'NPC' parsed and imported into project."); LastResult = true; break; case NPC.ParseType.Dialogue: App.Logger.Log("[ParseCommand] - Started parsing 'Dialogue'."); MainWindow.CurrentProject.data.dialogues.Add(pTool.ParseDialogue()); App.Logger.Log("[ParseCommand] - 'Dialogue' parsed and imported into project."); LastResult = true; break; case NPC.ParseType.Vendor: App.Logger.Log("[ParseCommand] - Started parsing 'Vendor'."); MainWindow.CurrentProject.data.vendors.Add(pTool.ParseVendor()); App.Logger.Log("[ParseCommand] - 'Vendor' parsed and imported into project."); LastResult = true; break; case NPC.ParseType.Quest: App.Logger.Log("[ParseCommand] - Started parsing 'Quest'."); MainWindow.CurrentProject.data.quests.Add(pTool.ParseQuest()); App.Logger.Log("[ParseCommand] - 'Quest' parsed and imported into project."); LastResult = true; break; default: LastResult = false; App.Logger.Log("[ParseCommand] - Invalid file."); break; } } else { LastResult = false; App.Logger.Log("[ParseCommand] - File not found."); } } }