public void OutputCmd(string name, BGIParameters param) { OpType op = paramLookup[name]; ParamCheck(name, param); OutputOpType(op); param.OutputAllParams(); }
public void ParamCheck(string op, BGIParameters param) { if (!paramLookup.TryGetValue(op, out OpType value) || param.CheckParamSig(value.Parameters)) { return; } throw new Exception(string.Format("{0}: {1} - {2}", line - 1, name, "Parameters were not of expected type!")); }
public void ParseOperation(ITree tree) { name = tree.GetChild(0).Text; line = tree.Line; BGIParameters param = (tree.ChildCount <= 1) ? new BGIParameters() : new BGIParameters(tree.GetChild(1)); if (paramLookup.ContainsKey(name)) { OutputCmd(name, param); } else { Debug.LogError("Unhandled Operation " + name); CmdOpNull(); } }