private void ExecuteAi() { Dictionary <string, string> programs = _user.ProgramSources; if (programs.Count == 0) { WriteLine("There are no stored AI programs."); return; } WriteLine("Stored AI programs:"); foreach (KeyValuePair <string, string> program in programs) { WriteLine(program.Key); } WriteLine(""); WriteLine(""); do { Write("Select a program to execute: "); string programName = ReadLine(); if (programName == "") { return; } if (!programs.ContainsKey(programName)) { WriteLine("The selected program does not exist."); continue; } var es = new ExecuteScreen(Reader, Writer, _user, programName); es.Start(); return; } while (true); }
private void ExecuteAi() { Dictionary<string, string> programs = _user.ProgramSources; if (programs.Count == 0) { WriteLine("There are no stored AI programs."); return; } WriteLine("Stored AI programs:"); foreach (KeyValuePair<string, string> program in programs) { WriteLine(program.Key); } WriteLine(""); WriteLine(""); do { Write("Select a program to execute: "); string programName = ReadLine(); if (programName == "") return; if (!programs.ContainsKey(programName)) { WriteLine("The selected program does not exist."); continue; } var es = new ExecuteScreen(Reader, Writer, _user, programName); es.Start(); return; } while (true); }