void ProcessValues(ref StageValue obj, out MetaStage minStage, out MetaStage maxStage, Expression inArg, out Expression outArg) { minStage = obj.MinStage; maxStage = obj.MaxStage; var stageArg = ProcessValue(inArg); if (stageArg.MinStage > minStage) { minStage = stageArg.MinStage; } if (stageArg.MaxStage < maxStage) { maxStage = stageArg.MaxStage; } if (maxStage < minStage) { maxStage = minStage; } outArg = ProcessStage(stageArg, minStage, maxStage).Value; obj = ProcessStage(obj, minStage, maxStage); }
void ProcessValues(out MetaStage minStage, out MetaStage maxStage, Expression inArg0, out Expression outArg0, Expression inArg1, out Expression outArg1) { var stageArg0 = ProcessValue(inArg0); var stageArg1 = ProcessValue(inArg1); minStage = stageArg0.MinStage; maxStage = stageArg0.MaxStage; if (stageArg1.MinStage > minStage) { minStage = stageArg1.MinStage; } if (stageArg1.MaxStage < maxStage) { maxStage = stageArg1.MaxStage; } if (maxStage < minStage) { maxStage = minStage; } outArg0 = ProcessStage(stageArg0, minStage, maxStage).Value; outArg1 = ProcessStage(stageArg1, minStage, maxStage).Value; }
Expression ProcessValuesToStage(MetaStage stage, Expression e) { return(ProcessStage(ProcessValue(e), stage, stage).Value); }
Expression[] ProcessValues(ref StageValue obj, out MetaStage minStage, out MetaStage maxStage, params Expression[] args) { switch (args.Length) { case 0: minStage = obj.MinStage; maxStage = obj.MaxStage; return(new Expression[0]); case 1: { Expression arg; ProcessValues(ref obj, out minStage, out maxStage, args[0], out arg); return(new[] { arg }); } case 2: { Expression arg0, arg1; ProcessValues(ref obj, out minStage, out maxStage, args[0], out arg0, args[1], out arg1); return(new[] { arg0, arg1 }); } default: { minStage = obj.MinStage; maxStage = obj.MaxStage; var stageArgs = new StageValue[args.Length]; for (int i = 0; i < args.Length; i++) { stageArgs[i] = ProcessValue(args[i]); if (stageArgs[i].MinStage > minStage) { minStage = stageArgs[i].MinStage; } if (stageArgs[i].MaxStage < maxStage) { maxStage = stageArgs[i].MaxStage; } } if (maxStage < minStage) { maxStage = minStage; } var result = new Expression[args.Length]; for (int i = 0; i < args.Length; i++) { result[i] = ProcessStage(stageArgs[i], minStage, maxStage).Value; } obj = ProcessStage(obj, minStage, maxStage); return(result); } } }