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) { 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) { 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) { 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); }