CInternalFunc(EInternalFunc inFuncType, IMathFunc[] args, int inStartPos, int inEndPos) { _type = inFuncType; _args = new CArgArray(args); StartLineIndex = inStartPos; EndLineIndex = inEndPos; }
public static CInternalFunc Create(string inFuncType, List <IMathFunc> args, int inStartPos, int inEndPos) { EInternalFunc t = Utils.ToEnum(inFuncType, EInternalFunc.Undefined); if (t == EInternalFunc.Undefined) { return(null); } if (args == null || args.Count == 0 || args.Count > 2) { return(null); } if (args.Count == 2 && t != EInternalFunc.Max && t != EInternalFunc.Min && t != EInternalFunc.Atan2 && t != EInternalFunc.Rand) { return(null); } return(new CInternalFunc(t, args.ToArray(), inStartPos, inEndPos)); }