private static String GetValue(ConCommandArgs args) { if (args.ValueCount != 1) { throw new Exception("Expected 1 argument: a member path"); } var match = _sLocationParser.Parse(args.Values[0]); if (!match.Success) { throw new Exception(match.Error.ToString()); } var member = FindMember(args.Domain, match[0]); return((member.GetValue() ?? "null").ToString()); }
public static void LogError(ConCommandArgs args) { Debug.LogError(args); }
public static void LogWarning(ConCommandArgs args) { Debug.LogWarning(args); }
public static Object Sum(ConCommandArgs args) { return(Enumerable.Range(0, args.ValueCount) .Sum(x => args.CanGet <double>(x) ? args.Get <double>(x) : 0d)); }
public static Object ArgCount(ConCommandArgs args) { return(args.Values.Length); }
public static Object Echo(ConCommandArgs args) { return(String.Format("\"{0}\"", String.Join("\" \"", args.Values))); }