Get() public method

public Get ( string name ) : Value
name string
return Value
コード例 #1
0
        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);

            CLS_Content.Value left = content.Get(value_name);
            ICLS_Type type = content.environment.GetType(left.type);
            CLType returntype;
            left.value = type.Math2Value(content, mathop, left.value, CLS_Content.Value.One, out returntype);
            //left.value = type.ConvertTo(content, left.value, v.type);
            //content.Set(value_name, left.value);

            content.OutStack(this);

            return content.Get(value_name);
        }
コード例 #2
0
        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);

            CLS_Content.Value left = content.Get(value_name);
            ICLS_Type         type = content.environment.GetType(left.type);
            CLType            returntype;

            left.value = type.Math2Value(content, mathop, left.value, CLS_Content.Value.One, out returntype);
            //left.value = type.ConvertTo(content, left.value, v.type);
            //content.Set(value_name, left.value);

            content.OutStack(this);

            return(content.Get(value_name));
        }
コード例 #3
0
        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            BetterList <CLS_Content.Value> _params = CLS_Content.NewParamList();

            for (int i = 0, count = listParam.Count; i < count; i++)
            {
                _params.Add(listParam[i].ComputeValue(content));
            }

            CLS_Content.Value retVal;
            SType.Function    fun;

            if (content.CallType != null && content.CallType.functions.TryGetValue(funcname, out fun))
            {
                if (fun.bStatic)
                {
                    retVal = content.CallType.StaticCall(content, funcname, _params);
                }
                else
                {
                    retVal = content.CallType.MemberCall(content, content.CallThis, funcname, _params);
                }
            }
            else
            {
                retVal = content.Get(funcname);
                Delegate sysDele = retVal.value as Delegate;
                if (sysDele != null)
                {
                    object[] args = CLS_Content.ParamObjsArray[_params.size];
                    for (int i = 0; i < _params.size; i++)
                    {
                        args[i] = _params[i].value;
                    }
                    retVal       = new CLS_Content.Value();
                    retVal.value = sysDele.DynamicInvoke(args);
                    if (retVal.value != null)
                    {
                        retVal.type = retVal.value.GetType();
                    }
                }
                else
                {
                    DeleFunction csleDele = retVal.value as DeleFunction;
                    if (csleDele.callthis != null)
                    {
                        retVal = csleDele.calltype.MemberCall(content, csleDele.callthis, csleDele.function, _params);
                    }
                    else
                    {
                        retVal = csleDele.calltype.StaticCall(content, csleDele.function, _params);
                    }
                }
            }
            CLS_Content.PoolParamList(_params);
            content.OutStack(this);
            return(retVal);
        }
コード例 #4
0
        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);

            var v = content.Get(value_name);
            ICLS_Type type = content.environment.GetType(v.type);
            CLType returntype;
            object value = type.Math2Value(content,mathop, v.value, CLS_Content.Value.One, out returntype);
            value = type.ConvertTo(content, value, v.type);
            content.Set(value_name, value);

            //操作变量之
            //做数学计算
            //从上下文取值
            //_value = null;
            content.OutStack(this);

            return content.Get(value_name);
        }
コード例 #5
0
        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            var value=content.Get(value_name);
            content.OutStack(this);

            //从上下文取值

            return value;
        }
コード例 #6
0
        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            var value = content.Get(value_name);

            content.OutStack(this);

            //从上下文取值

            return(value);
        }
コード例 #7
0
        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);

            var       v    = content.Get(value_name);
            ICLS_Type type = content.environment.GetType(v.type);
            CLType    returntype;
            object    value = type.Math2Value(content, mathop, v.value, CLS_Content.Value.One, out returntype);

            value = type.ConvertTo(content, value, v.type);
            content.Set(value_name, value);

            //操作变量之
            //做数学计算
            //从上下文取值
            //_value = null;
            content.OutStack(this);

            return(content.Get(value_name));
        }
コード例 #8
0
        public override CLS_Content.Value MemberCall(CLS_Content content, object object_this, string function, BetterList<CLS_Content.Value> _params, bool isBaseCall = false)
        {
            CLS_Content.Value retVal = null;

            Mathf newVal = (Mathf)object_this;
            if (function == "Equals")
            {
                retVal = new CLS_Content.Value();
                retVal.type = typeof(bool);
                retVal.value = newVal.Equals(_params[0].value);
            }
            else if (function == "ToString")
            {
                retVal = new CLS_Content.Value();
                retVal.type = typeof(string);
                retVal.value = newVal.ToString();
            }
            else
                return base.MemberCall(content, object_this, function, _params, isBaseCall);
            ICLS_Expression expLeft = content.CallExpression.listParam[0];
            CLS_Expression_GetValue expGetValue = expLeft as CLS_Expression_GetValue;
            if (expGetValue != null)
            {
                content.Set(expGetValue.value_name, newVal);
                return retVal;
            }
            CLS_Expression_MemberFind expMemberFind = expLeft as CLS_Expression_MemberFind;
            if (expMemberFind != null)
            {
                expGetValue = expMemberFind.listParam[0] as CLS_Expression_GetValue;
                CLS_Content.Value val = content.Get(expGetValue.value_name);
                content.environment.GetType(val.type).function.MemberValueSet(content, val.value, expMemberFind.membername, newVal);
                return retVal;
            }

            return base.MemberCall(content, object_this, function, _params, isBaseCall);
        }
コード例 #9
0
 public CLS_Content.Value ComputeValue(CLS_Content content)
 {
     return content.Get(value_name);
 }
コード例 #10
0
        public override void MemberValueSet(CLS_Content content, object object_this, string valuename, object value, bool isBaseCall = false)
        {
            Color newVal = (Color)object_this;
            if (valuename == "a")
                newVal.a = Convert.ToSingle(value);
            else if (valuename == "b")
                newVal.b = Convert.ToSingle(value);
            else if (valuename == "g")
                newVal.g = Convert.ToSingle(value);
            else if (valuename == "r")
                newVal.r = Convert.ToSingle(value);
            else
                base.MemberValueSet(content, object_this, valuename, value, isBaseCall);
            ICLS_Expression expLeft = content.CallExpression.listParam[0];
            CLS_Expression_GetValue expGetValue = expLeft as CLS_Expression_GetValue;
            if (expGetValue != null)
            {
                content.Set(expGetValue.value_name, newVal);
                return;
            }
            CLS_Expression_MemberFind expMemberFind = expLeft as CLS_Expression_MemberFind;
            if (expMemberFind != null)
            {
                expGetValue = expMemberFind.listParam[0] as CLS_Expression_GetValue;
                if (content.CallExpression is CLS_Expression_SelfOpWithValue)
                {
                    content.Set(expGetValue.value_name, newVal);
                    return;
                }
                CLS_Content.Value val = content.Get(expGetValue.value_name);
                content.environment.GetType(val.type).function.MemberValueSet(content, val.value, expMemberFind.membername, newVal);
                return;
            }

            base.MemberValueSet(content, object_this, valuename, value, isBaseCall);
        }
コード例 #11
0
        public override CLS_Content.Value MemberCall(CLS_Content content, object object_this, string function, BetterList<CLS_Content.Value> _params, bool isBaseCall = false)
        {
            CLS_Content.Value retVal = null;

            Vector3 newVal = (Vector3)object_this;
            if (function == "Equals")
            {
                retVal = new CLS_Content.Value();
                retVal.type = typeof(bool);
                retVal.value = newVal.Equals(_params[0].value);
            }
            else if (function == "Normalize")
            {
                newVal.Normalize();
                retVal = CLS_Content.Value.Void;
            }
            else if (function == "Scale")
            {
                newVal.Scale(((Vector3)_params[0].value));
                retVal = CLS_Content.Value.Void;
            }
            else if (function == "Set")
            {
                newVal.Set(Convert.ToSingle(_params[0].value), Convert.ToSingle(_params[1].value), Convert.ToSingle(_params[2].value));
                retVal = CLS_Content.Value.Void;
            }
            else if (function == "ToString")
            {
                if (_params.size == 0)
                {
                    retVal = new CLS_Content.Value();
                    retVal.type = typeof(string);
                    retVal.value = newVal.ToString();
                }
                else if (_params.size == 1)
                {
                    retVal = new CLS_Content.Value();
                    retVal.type = typeof(string);
                    retVal.value = newVal.ToString(((string)_params[0].value));
                }
            }
            else
                return base.MemberCall(content, object_this, function, _params, isBaseCall);
            ICLS_Expression expLeft = content.CallExpression.listParam[0];
            CLS_Expression_GetValue expGetValue = expLeft as CLS_Expression_GetValue;
            if (expGetValue != null)
            {
                content.Set(expGetValue.value_name, newVal);
                return retVal;
            }
            CLS_Expression_MemberFind expMemberFind = expLeft as CLS_Expression_MemberFind;
            if (expMemberFind != null)
            {
                expGetValue = expMemberFind.listParam[0] as CLS_Expression_GetValue;
                CLS_Content.Value val = content.Get(expGetValue.value_name);
                content.environment.GetType(val.type).function.MemberValueSet(content, val.value, expMemberFind.membername, newVal);
                return retVal;
            }

            return base.MemberCall(content, object_this, function, _params, isBaseCall);
        }
コード例 #12
0
        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            BetterList<CLS_Content.Value> _params = CLS_Content.NewParamList();
            for (int i = 0, count = listParam.Count; i < count; i++)
            {
                _params.Add(listParam[i].ComputeValue(content));
            }

            CLS_Content.Value retVal;
            SType.Function fun;

            if (content.CallType != null && content.CallType.functions.TryGetValue(funcname, out fun))
            {
                if (fun.bStatic)
                {
                    retVal = content.CallType.StaticCall(content, funcname, _params);
                }
                else
                {
                    retVal = content.CallType.MemberCall(content, content.CallThis, funcname, _params);
                }
            }
            else
            {
                retVal = content.Get(funcname);
                Delegate sysDele = retVal.value as Delegate;
                if (sysDele != null)
                {
                    object[] args = CLS_Content.ParamObjsArray[_params.size];
                    for (int i = 0; i < _params.size; i++)
                    {
                        args[i] = _params[i].value;
                    }
                    retVal = new CLS_Content.Value();
                    retVal.value = sysDele.DynamicInvoke(args);
                    if (retVal.value != null)
                        retVal.type = retVal.value.GetType();
                }
                else
                {
                    DeleFunction csleDele = retVal.value as DeleFunction;
                    if (csleDele.callthis != null)
                    {
                        retVal = csleDele.calltype.MemberCall(content, csleDele.callthis, csleDele.function, _params);
                    }
                    else
                    {
                        retVal = csleDele.calltype.StaticCall(content, csleDele.function, _params);
                    }
                }
            }
            CLS_Content.PoolParamList(_params);
            content.OutStack(this);
            return retVal;
        }
コード例 #13
0
        public override void MemberValueSet(CLS_Content content, object object_this, string valuename, object value, bool isBaseCall = false)
        {
            Quaternion newVal = (Quaternion)object_this;
            if (valuename == "eulerAngles")
                newVal.eulerAngles = ((Vector3)value);
            else if (valuename == "w")
                newVal.w = Convert.ToSingle(value);
            else if (valuename == "x")
                newVal.x = Convert.ToSingle(value);
            else if (valuename == "y")
                newVal.y = Convert.ToSingle(value);
            else if (valuename == "z")
                newVal.z = Convert.ToSingle(value);
            else
                base.MemberValueSet(content, object_this, valuename, value, isBaseCall);
            ICLS_Expression expLeft = content.CallExpression.listParam[0];
            CLS_Expression_GetValue expGetValue = expLeft as CLS_Expression_GetValue;
            if (expGetValue != null)
            {
                content.Set(expGetValue.value_name, newVal);
                return;
            }
            CLS_Expression_MemberFind expMemberFind = expLeft as CLS_Expression_MemberFind;
            if (expMemberFind != null)
            {
                expGetValue = expMemberFind.listParam[0] as CLS_Expression_GetValue;
                if (content.CallExpression is CLS_Expression_SelfOpWithValue)
                {
                    content.Set(expGetValue.value_name, newVal);
                    return;
                }
                CLS_Content.Value val = content.Get(expGetValue.value_name);
                content.environment.GetType(val.type).function.MemberValueSet(content, val.value, expMemberFind.membername, newVal);
                return;
            }

            base.MemberValueSet(content, object_this, valuename, value, isBaseCall);
        }
コード例 #14
0
 public CLS_Content.Value ComputeValue(CLS_Content content)
 {
     return(content.Get(value_name));
 }