CreateArray() 공개 메소드

public CreateArray ( ) : ScriptArray
리턴 ScriptArray
        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;
        }
예제 #2
0
        public override ScriptObject Clone()
        {
            ScriptArray ret = Script.CreateArray();

            for (int i = 0; i < m_listObject.Count; ++i)
            {
                ret.m_listObject.Add(m_listObject[i].Clone());
            }
            return(ret);
        }
예제 #3
0
        public ScriptArray GetValues()
        {
            ScriptArray ret = Script.CreateArray();

            foreach (KeyValuePair <object, ScriptObject> pair in m_listObject)
            {
                ret.Add(pair.Value.Assign());
            }
            return(ret);
        }
예제 #4
0
        public ScriptArray GetKeys()
        {
            ScriptArray ret = Script.CreateArray();

            foreach (KeyValuePair <object, ScriptObject> pair in m_listObject)
            {
                ret.Add(Script.CreateObject(pair.Key));
            }
            return(ret);
        }
예제 #5
0
        public override ScriptObject Clone()
        {
            ScriptArray ret = Script.CreateArray();

            ret.m_listObject = new ScriptObject[m_size];
            ret.m_size       = m_size;
            for (int i = 0; i < m_size; ++i)
            {
                if (m_listObject[i] == this)
                {
                    ret.m_listObject[i] = ret;
                }
                else if (m_listObject[i] == null)
                {
                    ret.m_listObject[i] = m_null;
                }
                else
                {
                    ret.m_listObject[i] = m_listObject[i].Clone();
                }
            }
            return(ret);
        }