public override void run(WhiskeyConsole console, string[] args) { if (args.Length != 2) { console.writeLine("Must supply object name and variable name."); } else { String path = args[1]; String[] pathNodes = path.Split('.'); String objName = pathNodes[0]; GameObject obj = GameManager.Objects.getObject(objName); if (obj == null) { console.writeLine("Could not find object, " + objName); } else { console.writeLine("OBJ: " + obj.Name); object latestObject = obj; for (int i = 1; i < pathNodes.Length; i++) { string nodeName = pathNodes[i]; if (latestObject == null) { console.writeLine("Value is null"); break; } PropertyInfo[] props = latestObject.GetType().GetProperties(); PropertyInfo prop = props.ToList().Find(p => p.Name.Equals(nodeName)); if (prop == null) { console.writeLine("No property named " + nodeName); break; } object nextObject = prop.GetValue(latestObject); latestObject = nextObject; } if (latestObject != null) { console.writeLine(path + " = " + latestObject); } } } }
public override void run(WhiskeyConsole console, string[] args) { List <String> commands = console.getCommandNames(); foreach (string command in commands) { if (!command.Equals("help")) { console.writeLine(" " + command); } } }
public override void run(WhiskeyConsole console, string[] args) { if (args.Length == 2) { string arg = args[1]; arg = arg.ToLower(); if (arg.Equals("0") || arg.Equals("n") || arg.Equals("off") || arg.Equals("no")) { HudManager.Instance.DebugVisible = false; } else if (arg.Equals("1") || arg.Equals("y") || arg.Equals("yes") || arg.Equals("on")) { HudManager.Instance.DebugVisible = true; } } }
public override void run(WhiskeyConsole console, string[] args) { GameManager.InputSource.requestReplay(); HudManager.Instance.ConsoleMode = false; if (args.Length == 2) { try { int m = int.Parse(args[1]); GameManager.Instance.TargetElapsedTime = new TimeSpan(0, 0, 0, 0, m); } catch (Exception e) { console.writeLine("not a integer"); } } }
public override void run(WhiskeyConsole console, string[] args) { GameManager.InputSource.requestRegular(); HudManager.Instance.ConsoleMode = false; GameManager.Instance.TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 17); }
public override void run(WhiskeyConsole console, string[] args) { console.writeLine("SYS EXIT"); console.writeLine("not yet impled"); //GameManager.Instance.close(); }
public override void run(WhiskeyConsole console, string[] args) { console.writeLine("current object count: " + GameManager.Objects.getAllObjects().Count); }
/// <summary> /// Process the command with given arguements from the console /// </summary> /// <param name="console">The console</param> /// <param name="args">The first element will always be equal to CommandName. After that, the line of text that the user entered on the console was space delim'd and sent as args</param> public abstract void run(WhiskeyConsole console, string[] args);