Exemplo n.º 1
0
        void IBescriptedPropertyGroup.Initialize(GlobalRuntimeContext globalContext)
        {
            scriptObject = ScriptParser.LexAndParseScript(
                script: Script,
                new FunctionSignature(
                    identifier: "Initialize",
                    returnType: typeof(int)),
                new FunctionSignature(
                    identifier: "Step",
                    returnType: typeof(int),
                    arguments: new VariableData("lastTrialCorrect", typeof(bool))),
                new FunctionSignature(
                    identifier: "End",
                    returnType: typeof(bool)),
                new FunctionSignature(
                    identifier: "CalculateThreshold",
                    returnType: typeof(double)));

            context = scriptObject.PrepareScript(globalContext);
        }
        void IBescriptedPropertyGroup.Initialize(GlobalRuntimeContext globalContext)
        {
            scriptObject = ScriptParser.LexAndParseScript(
                script: Script,
                new FunctionSignature(
                    identifier: "Initialize",
                    returnType: typeof(void)),
                new FunctionSignature(
                    identifier: "GetValue",
                    returnType: typeof(double),
                    arguments: new VariableData("stepNumber", typeof(int))),
                new FunctionSignature(
                    identifier: "CouldStepTo",
                    returnType: typeof(bool),
                    arguments: new VariableData("stepNumber", typeof(int))),
                new FunctionSignature(
                    identifier: "CalculateThreshold",
                    returnType: typeof(double),
                    arguments: new VariableData("stepValue", typeof(double))));

            context = scriptObject.PrepareScript(globalContext);
        }