Blamite.Blam.Scripting.Compiler.ScriptCompiler.CreateScriptReference C# (CSharp) Method

CreateScriptReference() private method

private CreateScriptReference ( Blamite.Blam.Scripting.Compiler.ScriptInfo info, ushort returnTypeOpcode, uint textPosition, short lineNumber ) : void
info Blamite.Blam.Scripting.Compiler.ScriptInfo
returnTypeOpcode ushort
textPosition uint
lineNumber short
return void
        private void CreateScriptReference(ScriptInfo info, ushort returnTypeOpcode, uint textPosition, short lineNumber)
        {
            var scriptReference = new ScriptExpression
            {
                Index = _currentIndex,
                Opcode = info.Opcode,
                ReturnType = returnTypeOpcode,
                Type = ScriptExpressionType.ScriptReference,
                Next = DatumIndex.Null,
                StringOffset = textPosition,
                Value = new LongExpressionValue(_currentIndex.Next),
                LineNumber = lineNumber
            };
            OpenDatumAddExpressionIncrement(scriptReference);

            var nameExpression = new ScriptExpression
            {
                Index = _currentIndex,
                Opcode = info.Opcode,
                ReturnType = _opcodes.GetTypeInfo("function_name").Opcode,
                Type = ScriptExpressionType.Expression,
                Next = DatumIndex.Null,
                StringOffset = _strings.Cache(info.Name),
                Value = new LongExpressionValue(0),
                LineNumber = lineNumber
            };
            OpenDatumAddExpressionIncrement(nameExpression);
        }
    }