コード例 #1
0
        static string GenerateInitializerTwoInput()
        {
            string funcStruct = @"
    void GeneratedProcessorInitializerTwoInput(NodeProcessor processor, ValueTypeConfig aConfig, ValueTypeConfig bConfig)
    {
        if (aConfig.IsVector && bConfig.IsVector)
        {";

            foreach (ValueType vector in Vectors)
            {
                funcStruct += FunctionGenerator.GenerateAnonymousFuncForNodeProcessor(new[] { vector, vector }, vector, "OperationTwoInput({0}, {1})", 3);
            }

            funcStruct += @"
        }
        else if (aConfig.IsVector && !bConfig.IsVector)
        {
            if (bConfig.ValueType == ValueType.Float)
            {";
            foreach (ValueType vector in Vectors)
            {
                funcStruct += FunctionGenerator.GenerateAnonymousFuncForNodeProcessor(new[] { vector, ValueType.Float }, vector, "OperationTwoInput({0}, {1})", 3);
            }
            funcStruct += @"
            }
            else
            {";
            foreach (ValueType vector in Vectors)
            {
                funcStruct += FunctionGenerator.GenerateAnonymousFuncForNodeProcessor(new[] { vector, ValueType.Int }, vector, "OperationTwoInput({0}, {1})", 3);
            }
            funcStruct += @"
            }
        }
        else if (!aConfig.IsVector && bConfig.IsVector)
        {
            if (aConfig.ValueType == ValueType.Float)
            {";
            foreach (ValueType vector in Vectors)
            {
                funcStruct += FunctionGenerator.GenerateAnonymousFuncForNodeProcessor(new[] { ValueType.Float, vector }, vector, "OperationTwoInput({0}, {1})", 3);
            }
            funcStruct += @"
            }
            else
            {";
            foreach (ValueType vector in Vectors)
            {
                funcStruct += FunctionGenerator.GenerateAnonymousFuncForNodeProcessor(new[] { ValueType.Int, vector }, vector, "OperationTwoInput({0}, {1})", 3);
            }
            funcStruct += @"
            }
        }
        else if (!aConfig.IsVector && !bConfig.IsVector)
        {
            if (aConfig.ValueType == ValueType.Float)
            {
                if (bConfig.ValueType == ValueType.Float)
                {";
            funcStruct += FunctionGenerator.GenerateAnonymousFuncForNodeProcessor(new[] { ValueType.Float, ValueType.Float }, ValueType.Float, "OperationTwoInput({0}, {1})", 3);
            funcStruct += @"
                }
                else
                {";
            funcStruct += FunctionGenerator.GenerateAnonymousFuncForNodeProcessor(new[] { ValueType.Float, ValueType.Int }, ValueType.Float, "OperationTwoInput({0}, {1})", 3);
            funcStruct += @"
                }
            }
            else
            {
                if (bConfig.ValueType == ValueType.Float)
                {";
            funcStruct += FunctionGenerator.GenerateAnonymousFuncForNodeProcessor(new[] { ValueType.Int, ValueType.Float }, ValueType.Float, "OperationTwoInput({0}, {1})", 3);
            funcStruct += @"
                }
                else
                {";
            funcStruct += FunctionGenerator.GenerateAnonymousFuncForNodeProcessor(new[] { ValueType.Int, ValueType.Int }, ValueType.Int, "OperationTwoInputInt({0}, {1})", 3);
            funcStruct += @"
                }
            }
        }
    }
";
            return(funcStruct);
        }