예제 #1
0
 private static void ColorVerticalPixel(Dictionary<Tuple<int, int>, string> _table, string _cmd)
 {
     CmdParser cp = new CmdParser();
     var inputs = cp.ProcessInput(_cmd);
     ImageDrawer d = new ImageDrawer();
     d.ColorVerticalPixels(_table, Convert.ToInt32(inputs[1]), Convert.ToInt32(inputs[2]), Convert.ToInt32(inputs[3]), inputs[4]);
 }
예제 #2
0
        private static void CommandsMenu(Dictionary<Tuple<int, int>, string> _table)
        {
            Console.Write("Enter a command: ");
            string cmd = Console.ReadLine();
            CmdParser cp = new CmdParser();

            switch (cp.chkInput(cmd))
            {
                case "Color Pixel":
                    ColorPixel(_table, cmd);
                    CommandsMenu(_table);
                    break;
                case "Color Vertical Pixel":
                    ColorVerticalPixel(_table, cmd);
                    CommandsMenu(_table);
                    break;
                case "Color Horizontal Pixel":
                    ColorHorizontalPixel(_table, cmd);
                    CommandsMenu(_table);
                    break;
                case "Show Content":
                    ShowGrid(_table);
                    CommandsMenu(_table);
                    break;
                case "Terminate Program":
                    TerminateProgram();
                    break;
                case "Clear Content":
                    ClearTable(_table);
                    CommandsMenu(_table);
                    break;
                case "Invalid Command":
                    Console.WriteLine("This is not a known command");
                    CommandsMenu(_table);
                    break;
            }
        }