예제 #1
0
 public TempCase(Script script, List<object> allow, ScriptExecutable executable, Executable_Block block)
 {
     m_Script = script;
     this.Allow = allow;
     this.Executable = executable;
     this.Block = block;
 }
 public ScorpioScriptFunction(Script script, List<String> listParameters, ScriptExecutable scriptExecutable, bool bParams) {
     this.m_Script = script;
     this.m_ListParameters = listParameters.ToArray();
     this.m_ScriptExecutable = scriptExecutable;
     this.m_ParameterCount = listParameters.Count;
     this.m_Params = bParams;
 }
예제 #3
0
 public TempCondition(Script script, CodeObject allow, ScriptExecutable executable, Executable_Block block)
 {
     m_Script = script;
     this.Allow = allow;
     this.Executable = executable;
     this.Block = block;
 }
예제 #4
0
 public ScriptContext(Script script, ScriptExecutable scriptExecutable, ScriptContext parent, Executable_Block block)
 {
     m_script = script;
     m_parent = parent;
     m_scriptExecutable = scriptExecutable;
     m_variableDictionary.Clear();
     m_block = block;
     m_InstructionCount = m_scriptExecutable != null ? m_scriptExecutable.Count : 0;
 }
예제 #5
0
 public ScriptContext(Script script, ScriptExecutable scriptExecutable, ScriptContext parent, Executable_Block block)
 {
     m_script           = script;
     m_parent           = parent;
     m_scriptExecutable = scriptExecutable;
     m_variableDictionary.Clear();
     m_block            = block;
     m_InstructionCount = m_scriptExecutable != null ? m_scriptExecutable.Count : 0;
 }
        private ScriptExecutable m_ScriptExecutable; //函数执行命令

        #endregion Fields

        #region Constructors

        public ScorpioScriptFunction(Script script, List<String> listParameters, ScriptExecutable scriptExecutable, bool bParams)
        {
            this.m_Script = script;
            this.m_ListParameters = new List<string>(listParameters);
            this.m_ScriptExecutable = scriptExecutable;
            this.m_ParameterCount = listParameters.Count;
            this.m_Params = bParams;
            this.m_ParamsArray = bParams ? script.CreateArray() : null;
        }
예제 #7
0
 public ScriptContext(Script script, ScriptExecutable scriptExecutable, ScriptContext parent, Executable_Block block) {
     m_script = script;
     m_parent = parent;
     m_block = block;
     m_variableDictionary = new Dictionary<String, ScriptObject>();
     if (scriptExecutable != null) {
         m_scriptInstructions = scriptExecutable.ScriptInstructions;
         m_InstructionCount = m_scriptInstructions.Length;
     }
 }
예제 #8
0
 public ScriptContext(Script script, ScriptExecutable scriptExecutable, ScriptContext parent, Executable_Block block)
 {
     m_script             = script;
     m_parent             = parent;
     m_block              = block;
     m_variableDictionary = new Dictionary <String, ScriptObject>();
     if (scriptExecutable != null)
     {
         m_scriptInstructions = scriptExecutable.ScriptInstructions;
         m_InstructionCount   = m_scriptInstructions.Length;
     }
 }
예제 #9
0
        private ScriptObject Execute(ScriptExecutable executable)
        {
            if (executable == null)
            {
                return(null);
            }
            Reset();
            ScriptInstruction[] scriptInstructions = executable.ScriptInstructions;
            int iInstruction      = 0;
            int iInstructionCount = scriptInstructions.Length;

            while (iInstruction < iInstructionCount && !IsExecuted)
            {
                m_scriptInstruction = scriptInstructions[iInstruction++];
                ExecuteInstruction();
            }
            return(m_returnObject);
        }
예제 #10
0
        private ScriptObject Execute(ScriptExecutable executable)
        {
            if (executable == null)
            {
                return(null);
            }
            Reset();
            int iInstruction      = 0;
            int iInstructionCount = executable.Count;

            while (iInstruction < iInstructionCount)
            {
                m_scriptInstruction = executable[iInstruction++];
                ExecuteInstruction();
                if (IsOver)
                {
                    break;
                }
            }
            return(m_returnObject);
        }
예제 #11
0
        private ScriptObject Execute(ScriptExecutable executable)
        {
            if (executable == null)
            {
                return(null);
            }
            this.Reset();
            ScriptInstruction[] scriptInstructions = executable.ScriptInstructions;
            int num    = 0;
            int length = scriptInstructions.Length;

            while (num < length)
            {
                this.m_scriptInstruction = scriptInstructions[num++];
                this.ExecuteInstruction();
                if (this.IsExecuted)
                {
                    break;
                }
            }
            return(this.m_returnObject);
        }
예제 #12
0
        private bool m_Over     = false;                                    //函数是否已经结束

        public ScriptContext(Script script, ScriptExecutable scriptExecutable) : this(script, scriptExecutable, null, Executable_Block.None)
        {
        }
예제 #13
0
 public ScriptContext(Script script, ScriptExecutable scriptExecutable, ScriptContext parent) : this(script, scriptExecutable, parent, Executable_Block.None) { }
예제 #14
0
 private bool m_Over = false;                                        //函数是否已经结束
 
 public ScriptContext(Script script, ScriptExecutable scriptExecutable) : this(script, scriptExecutable, null, Executable_Block.None) { }
예제 #15
0
 private ScriptObject Execute(ScriptExecutable executable)
 {
     if (executable == null) return null;
     Reset();
     ScriptInstruction[] scriptInstructions = executable.ScriptInstructions;
     int iInstruction = 0;
     int iInstructionCount = scriptInstructions.Length ;
     while (iInstruction < iInstructionCount) {
         m_scriptInstruction = scriptInstructions[iInstruction++];
         ExecuteInstruction();
         if (IsExecuted) break;
     }
     return m_returnObject;
 }
예제 #16
0
 public CodeObject[] Allow;             //判断条件
 public TempCase(Script script, List<CodeObject> allow, ScriptExecutable executable) {
     this.Allow = allow != null ? allow.ToArray() : new CodeObject[0];
     this.Executable = executable;
 }
예제 #17
0
        public ScriptExecutable Executable; //指令列表

        #endregion Fields

        #region Constructors

        public TempCondition(Script script, CodeObject allow, ScriptExecutable executable, Executable_Block block)
        {
            this.Allow = allow;
            this.Executable = executable;
            this.Context = new ScriptContext(script, executable, null, block);
        }
예제 #18
0
 public CodeCallBlock(ScriptExecutable executable) {
     this.Executable = executable;
 }
예제 #19
0
        public ScriptExecutable Executable; //指令列表

        #endregion Fields

        #region Constructors

        public TempCase(Script script, List<object> allow, ScriptExecutable executable, Executable_Block block)
        {
            this.Allow = allow;
            this.Executable = executable;
            this.Context = new ScriptContext(script, executable, null, block);
        }
예제 #20
0
 public ScriptContext(Script script, ScriptExecutable scriptExecutable, ScriptContext parent) : this(script, scriptExecutable, parent, Executable_Block.None)
 {
 }
예제 #21
0
 public void BeginExecutable(Executable_Block block)
 {
     m_scriptExecutable = new ScriptExecutable(block);
     m_Executables.Push(m_scriptExecutable);
 }
예제 #22
0
 public void EndExecutable()
 {
     m_Executables.Pop();
     m_scriptExecutable = (m_Executables.Count > 0) ? m_Executables.Peek() : null;
 }
예제 #23
0
 public void SetContextExecutable(ScriptExecutable blockExecutable)
 {
     BlockExecutable = blockExecutable;
     BlockContext = new ScriptContext(m_Script, blockExecutable, null, Executable_Block.For);
 }
예제 #24
0
 public ScriptContext(Script script, ScriptExecutable scriptExecutable, Executable_Block block) : this(script, scriptExecutable, null, block)
 {
 }