public void onConsoleLine(TConsoleLineEvent e) { Console.WriteLine("cmd:" + e.command); if (e.command == "p") { if (File.Exists("debug.png")) File.Delete("debug.png"); adapter.saveCacheFile("debug.png"); } }
public void onConsoleLine(TConsoleLineEvent e) { GC.Collect(2); var notFound = false; switch (e.command) { case "all-pins-on": allPinsOn(); break; case "pon": case "pin-on": setPin(int.Parse(e.args[0]), true); break; case "poff": case "pin-off": setPin(int.Parse(e.args[0]), false); break; case "all-leds-on": allLEDsOn(); break; case "switches": switchTest(); break; case "all-sipo-on": case "ason": if (e.args.Length == 0) setAllSipo(true); else setAllSipo(true, int.Parse(e.args[0])); break; case "all-sipo-off": case "asoff": if (e.args.Length == 0) setAllSipo(false); else setAllSipo(false, int.Parse(e.args[0])); break; case "leddemo": ledDemo(); break; case "t1": test1(); break; default: notFound = true; break; } if (notFound) Console.WriteLine("invalid command"); else Console.WriteLine("command processed"); }
public override void onConsoleLine(TConsoleLineEvent e) { base.onConsoleLine(e); switch (e.command) { case "newgame": app.game.newGame(); //app.engine.newGame(); break; case "d": app.engine.debug(); break; case "k": System.Diagnostics.Process.GetCurrentProcess().Kill(); break; case "setpiece": foreach (var oldHandler in ioController.handlers.findByType(typeof(TChangeBoardHandler))) oldHandler.uninstall(); var h = new TSetPieceHandler(TChessBoard.getPieceFromChar((char)e.args[0][0])); h.install(); foreach (var handler in app.ioController.handlers) if (handler is TMoveHandler) handler.suspend(); break; case "screenshot": Program.app.ui.saveScreenShot(); break; case "clearboard": app.clearBoard(); //engine.debug(); break; case "quit": app.quit(); break; } }
public override void onConsoleLine(TConsoleLineEvent e) { base.onConsoleLine(e); if (e.command == "f1") { foreach (var h in ioController.handlers) Console.WriteLine(h.GetType().Name); } }
public override void onConsoleLine(TConsoleLineEvent e) { base.onConsoleLine(e); if (e.line == "") { Console.WriteLine("set pieces done"); uninstall(); foreach (var handler in app.ioController.handlers) if (handler is TMoveHandler) handler.resume(); } }