예제 #1
0
        public ITES5ValueCodeChunk ConvertFunction(ITES5Referencer calledOn, TES4Function function, TES5CodeScope codeScope, TES5GlobalScope globalScope, TES5MultipleScriptsScope multipleScriptsScope)
        {
            ITES5ValueCodeChunk      isPlayable = getIsPlayableRaceFactory.ConvertFunction(calledOn, function, codeScope, globalScope, multipleScriptsScope);
            TES5ComparisonExpression comparison = new TES5ComparisonExpression(isPlayable, TES5ComparisonExpressionOperator.OPERATOR_EQUAL, new TES5Bool(false));

            return(comparison);
        }
        public ITES5ValueCodeChunk CreateCodeChunk(ITES4Callable chunk, TES5CodeScope codeScope, TES5GlobalScope globalScope, TES5MultipleScriptsScope multipleScriptsScope)
        {
            TES4Function     function          = chunk.Function;
            ITES5Referencer  calledOnReference = this.CreateCalledOnReferenceOfCalledFunction(chunk, codeScope, globalScope, multipleScriptsScope);
            string           functionName      = function.FunctionCall.FunctionName;
            string           functionKey       = functionName.ToLower();
            IFunctionFactory factory;

            if (!this.functionFactories.TryGetValue(functionKey, out factory))
            {
                throw new ConversionException("Cannot convert function " + functionName + " as conversion handler is not defined.");
            }
            ITES5ValueCodeChunk codeChunk = factory.ConvertFunction(calledOnReference, function, codeScope, globalScope, multipleScriptsScope);

            return(codeChunk);
        }