public static bool check_isinherits(RunTimeDataType srcType, RunTimeDataType type, IClassFinder classfinder)
        {
            var srcCls = classfinder.getClassByRunTimeDataType(srcType);
            var cls    = classfinder.getClassByRunTimeDataType(type);

            return(isInherits(srcCls, cls));
        }
        public static bool check_isImplements(RunTimeValueBase value, RunTimeDataType type, IClassFinder classfinder)
        {
            var cls = classfinder.getClassByRunTimeDataType(type);

            return(isImplements(((rtData.rtObjectBase)value).value._class, cls));
        }
        public bool rtValueToLinkObject
            (RunTimeValueBase value,Type linkType,IClassFinder bin,bool needclone,out object linkobject)
        {
            RunTimeDataType vt = value.rtType;

            if (vt == RunTimeDataType.rt_null)
            {
                linkobject = null;
                return(true);
            }

            if (vt > RunTimeDataType.unknown)
            {
                var cls = bin.getClassByRunTimeDataType(vt);

                RunTimeDataType ot;
                if (TypeConverter.Object_CanImplicit_ToPrimitive(
                        cls,out ot
                        ))
                {
                    vt    = ot;
                    value = TypeConverter.ObjectImplicit_ToPrimitive((ASBinCode.rtData.rtObjectBase)value);
                }
                else if (linkType is AS3Class_Type && cls.staticClass == null)
                {
                    if (cls.getRtType() == ((AS3Class_Type)linkType).rttype)
                    {
                        linkobject = ((AS3Class_Type)linkType).linktype;
                        return(true);
                    }
                }
            }
            RunTimeDataType at =
                getRuntimeDataType(
                    linkType);

            if (at == RunTimeDataType.rt_int)
            {
                linkobject = (TypeConverter.ConvertToInt(value));
            }
            else if (at == RunTimeDataType.rt_uint)
            {
                linkobject = (TypeConverter.ConvertToUInt(value,null,null));
            }
            else if (at == RunTimeDataType.rt_string)
            {
                linkobject = (TypeConverter.ConvertToString(value,null,null));
            }
            else if (at == RunTimeDataType.rt_number)
            {
                linkobject = (TypeConverter.ConvertToNumber(value));
            }
            else if (at == RunTimeDataType.rt_boolean)
            {
                var b = TypeConverter.ConvertToBoolean(value,null,null);
                linkobject = b.value;
            }
            else if (at == RunTimeDataType.rt_array)
            {
                linkobject = (ASBinCode.rtData.rtArray)value;
            }
            else if (at == RunTimeDataType.rt_function)
            {
                if (needclone)
                {
                    linkobject = (ASBinCode.rtData.rtFunction)value;
                }
                else
                {
                    linkobject = ((ASBinCode.rtData.rtFunction)value).Clone();
                }
            }
            else if (at == _OBJECT_LINK)
            {
                if (vt > RunTimeDataType.unknown)
                {
                    if (needclone)
                    {
                        linkobject = ((ASBinCode.rtData.rtObjectBase)value).Clone();
                    }
                    else
                    {
                        linkobject = (ASBinCode.rtData.rtObjectBase)value;
                    }
                }
                else
                {
                    if (needclone)
                    {
                        linkobject = value.Clone();
                    }
                    else
                    {
                        linkobject = value;
                    }
                }
            }
            else if (at > RunTimeDataType.unknown)
            {
                if (vt > RunTimeDataType.unknown)
                {
                    Class c = bin.getClassByRunTimeDataType(vt);
                    if (c.isLink_System)
                    {
                        LinkSystemObject lo = (LinkSystemObject)((ASBinCode.rtData.rtObjectBase)value).value;
                        linkobject = lo.GetLinkData();
                    }
                    else if (c.isCrossExtend)
                    {
                        LinkSystemObject lo = (LinkSystemObject)((ASBinCode.rtData.rtObjectBase)value).value;
                        linkobject = lo.GetLinkData();
                    }
                    else if (c.staticClass == null)
                    {
                        if (c.instanceClass.isCrossExtend)
                        {
                            //***isCrossExtend Class转换为 基础类型的type
                            var sc = c.instanceClass.super;
                            while (!sc.isLink_System)
                            {
                                sc = sc.super;
                            }

                            var nf = (ICrossExtendAdapterCreator)swc.getNativeFunction(((ClassMethodGetter)sc.crossExtendAdapterCreator.bindField).functionId);

                            linkobject = nf.GetAdapterType();
                        }
                        else
                        {
                            linkobject = null;
                            return(false);
                        }
                    }
                    else
                    {
                        linkobject = null;
                        return(false);
                    }
                }
                else if (at == _objectType_) //托管object
                {
                    if (vt == RunTimeDataType.rt_int)
                    {
                        linkobject = (TypeConverter.ConvertToInt(value));
                    }
                    else if (vt == RunTimeDataType.rt_uint)
                    {
                        linkobject = (TypeConverter.ConvertToUInt(value,null,null));
                    }
                    else if (vt == RunTimeDataType.rt_string)
                    {
                        linkobject = (TypeConverter.ConvertToString(value,null,null));
                    }
                    else if (vt == RunTimeDataType.rt_number)
                    {
                        linkobject = (TypeConverter.ConvertToNumber(value));
                    }
                    else if (vt == RunTimeDataType.rt_boolean)
                    {
                        var b = TypeConverter.ConvertToBoolean(value,null,null);
                        linkobject = b.value;
                    }
                    else if (vt == RunTimeDataType.rt_void)
                    {
                        linkobject = null;
                    }
                    else
                    {
                        linkobject = null;
                        return(false);
                    }
                }
                else
                {
                    linkobject = null;
                    return(false);
                }
            }
            else
            {
                linkobject = null;
                return(false);
            }

            return(true);
        }
            public override SLOT assign(RunTimeValueBase value,out bool success)
            {
                if (vector_data.vector_type != value.rtType
                    &&
                    !
                    (
                        //***检查子类关系****
                        (vector_data.vector_type > RunTimeDataType.unknown &&
                         value.rtType > RunTimeDataType.unknown &&
                         (
                             ClassMemberFinder.check_isinherits(value,vector_data.vector_type,classfinder)
                             ||
                             ClassMemberFinder.check_isImplements(value,vector_data.vector_type,classfinder)
                         )
                        )
                        ||
                        (
                            vector_data.vector_type > RunTimeDataType.unknown &&
                            value.rtType == RunTimeDataType.rt_null
                        )
                        ||
                        (
                            vector_data.vector_type == RunTimeDataType.rt_array &&
                            value.rtType == RunTimeDataType.rt_null
                        )
                        ||
                        (
                            vector_data.vector_type == RunTimeDataType.rt_function &&
                            value.rtType == RunTimeDataType.rt_null
                        )
                        ||
                        (
                            vector_data.vector_type == RunTimeDataType.rt_string &&
                            value.rtType == RunTimeDataType.rt_null
                        )
                    )
                    )
                {
                    //return false;
                    success = false;
                    return(this);
                }
                else
                {
                    switch (value.rtType)
                    {
                    case RunTimeDataType.rt_int:
                    {
                        ((rtInt)vector_data.innnerList[idx]).value = ((rtInt)value).value;
                        success = true;
                        return(this);
                    }

                    case RunTimeDataType.rt_uint:
                    {
                        ((rtUInt)vector_data.innnerList[idx]).value = ((rtUInt)value).value;
                        success = true;
                        return(this);
                    }

                    case RunTimeDataType.rt_number:
                    {
                        ((rtNumber)vector_data.innnerList[idx]).value = ((rtNumber)value).value;
                        success = true;
                        return(this);
                    }

                    case RunTimeDataType.rt_string:
                    {
                        ((rtString)vector_data.innnerList[idx]).value = ((rtString)value).value;
                        success = true;
                        return(this);
                    }

                    case RunTimeDataType.rt_function:
                    {
                        ((rtFunction)vector_data.innnerList[idx]).CopyFrom((rtFunction)value);
                        success = true;
                        return(this);
                    }

                    default:
                        break;
                    }

                    if (value.rtType > RunTimeDataType.unknown)
                    {
                        var vd = vector_data.innnerList[idx];
                        if (vd != null)
                        {
                            var cls = classfinder.getClassByRunTimeDataType(value.rtType);
                            if (cls.isLink_System)
                            {
                                ASBinCode.rtti.LinkSystemObject link = (ASBinCode.rtti.LinkSystemObject)((rtObjectBase)vd).value;

                                if (cls.isStruct)
                                {
                                    link.CopyStructData((ASBinCode.rtti.LinkSystemObject)((rtObjectBase)value).value);
                                }
                                else
                                {
                                    ((rtObjectBase)vd).value = ((rtObjectBase)value).value;
                                }
                                success = true;
                                return(this);
                            }
                        }
                    }

                    vector_data.innnerList[idx] = (RunTimeValueBase)value.Clone();                     //对容器的直接赋值,需要Clone																				   //return true;
                    success = true;
                    return(this);
                }
            }
        public void storeLinkObject_ToSlot(object obj, RunTimeDataType defineReturnType, SLOT returnSlot,IClassFinder bin,Player player)
        {
            if (obj is ICrossExtendAdapter)
            {
                obj = ((ICrossExtendAdapter)obj).AS3Object;
            }

            if (obj == null)
            {
                returnSlot.setValue(ASBinCode.rtData.rtNull.nullptr);
            }
            else
            {
                RunTimeDataType rt = defineReturnType;                 //getLinkType(funcDefine.signature.returnType);
                //RunTimeDataType rt =
                //    getRuntimeDataType(obj.GetType());
                if (rt == RunTimeDataType.rt_void)
                {
                    rt = getRuntimeDataType(obj.GetType());

                    if (rt == _FLOAT)
                    {
                        rt = RunTimeDataType.rt_number;
                    }
                    else if (rt == _SHORT)
                    {
                        rt = RunTimeDataType.rt_int;
                    }
                    else if (rt == _USHORT)
                    {
                        rt = RunTimeDataType.rt_uint;
                    }
                }

                if (rt == _DICT_KEY)
                {
                    DictionaryKey key = (DictionaryKey)obj;
                    rt  = _OBJECT_LINK;
                    obj = key.key;
                }

                if (rt == RunTimeDataType._OBJECT)
                {
                    rt = _OBJECT_LINK;
                }
                if (rt == _OBJECT_LINK)
                {
                    rt = ((RunTimeValueBase)obj).rtType;
                    if (rt < RunTimeDataType.unknown)                    //否则走下面的Object路径
                    {
                        returnSlot.directSet((RunTimeValueBase)obj);
                        return;
                    }
                }

                if (rt == RunTimeDataType.rt_int)
                {
                    var realObjType = getRuntimeDataType(obj.GetType());
                    if (realObjType == RunTimeDataType.rt_uint)
                    {
                        returnSlot.setValue((int)(uint)obj);
                    }
                    else if (realObjType == RunTimeDataType.rt_number)
                    {
                        returnSlot.setValue((int)(double)obj);
                    }
                    else if (realObjType == _FLOAT)
                    {
                        returnSlot.setValue((int)(float)obj);
                    }
                    else if (realObjType == _SHORT)
                    {
                        returnSlot.setValue((int)(short)obj);
                    }
                    else if (realObjType == _USHORT)
                    {
                        returnSlot.setValue((int)(ushort)obj);
                    }
                    else
                    {
                        returnSlot.setValue((int)obj);
                    }
                }
                else if (rt == RunTimeDataType.rt_uint)
                {
                    var realObjType = getRuntimeDataType(obj.GetType());
                    if (realObjType == RunTimeDataType.rt_int)
                    {
                        returnSlot.setValue((uint)(int)obj);
                    }
                    else if (realObjType == RunTimeDataType.rt_number)
                    {
                        returnSlot.setValue((uint)(double)obj);
                    }
                    else if (realObjType == _FLOAT)
                    {
                        returnSlot.setValue((uint)(float)obj);
                    }
                    else if (realObjType == _SHORT)
                    {
                        returnSlot.setValue((uint)(short)obj);
                    }
                    else if (realObjType == _USHORT)
                    {
                        returnSlot.setValue((uint)(ushort)obj);
                    }
                    else
                    {
                        returnSlot.setValue((uint)obj);
                    }
                }
                else if (rt == RunTimeDataType.rt_string)
                {
                    var realObjType = getRuntimeDataType(obj.GetType());
                    returnSlot.setValue((string)obj);
                }
                else if (rt == RunTimeDataType.rt_number)
                {
                    var realObjType = getRuntimeDataType(obj.GetType());
                    if (realObjType == RunTimeDataType.rt_uint)
                    {
                        returnSlot.setValue((double)(uint)obj);
                    }
                    else if (realObjType == RunTimeDataType.rt_int)
                    {
                        returnSlot.setValue((double)(int)obj);
                    }
                    else if (realObjType == _FLOAT)
                    {
                        returnSlot.setValue((double)(float)obj);
                    }
                    else if (realObjType == _SHORT)
                    {
                        returnSlot.setValue((double)(short)obj);
                    }
                    else if (realObjType == _USHORT)
                    {
                        returnSlot.setValue((double)(ushort)obj);
                    }
                    else
                    {
                        returnSlot.setValue((double)obj);
                    }
                }
                else if (rt == RunTimeDataType.rt_boolean)
                {
                    if ((bool)obj)
                    {
                        returnSlot.setValue(ASBinCode.rtData.rtBoolean.True);
                    }
                    else
                    {
                        returnSlot.setValue(ASBinCode.rtData.rtBoolean.False);
                    }
                }
                else if (rt == RunTimeDataType.rt_array)
                {
                    returnSlot.directSet((ASBinCode.rtData.rtArray)obj);
                }
                else if (rt == RunTimeDataType.rt_function)
                {
                    returnSlot.directSet((ASBinCode.rtData.rtFunction)obj);
                }
                else if (rt > RunTimeDataType.unknown)
                {
                    Class rtCls;                    // = ((ASBinCode.rtData.rtObject)obj).value._class; //bin.getClassByRunTimeDataType(rt);
                    ASBinCode.rtData.rtObjectBase testObj = obj as ASBinCode.rtData.rtObjectBase;
                    if (testObj != null)
                    {
                        rtCls = ((ASBinCode.rtData.rtObjectBase)obj).value._class;

                        if (rtCls.isLink_System)
                        {
                            var f = ((CSWC)bin).class_Creator[rtCls];
                            f.setLinkObjectValueToSlot(returnSlot,player,
                                                       ((LinkSystemObject)testObj.value).GetLinkData(),rtCls);
                        }
                        else
                        {
                            returnSlot.directSet((ASBinCode.rtData.rtObjectBase)obj);
                        }
                    }
                    else
                    {
                        rtCls = bin.getClassByRunTimeDataType(rt);

                        if (rtCls.classid == player.swc.TypeClass.classid)
                        {
                            Type type = obj as Type;
                            if (type != null)
                            {
                                try
                                {
                                    var rttype = getRuntimeDataType(type);
                                    if (rttype < RunTimeDataType.unknown
                                        &&
                                        player.swc.primitive_to_class_table[rttype] != null
                                        )
                                    {
                                        rttype = player.swc.primitive_to_class_table[rttype].getRtType();
                                    }

                                    var rtcls = bin.getClassByRunTimeDataType(rttype);

                                    if (player.init_static_class(rtcls,SourceToken.Empty))
                                    {
                                        returnSlot.directSet(
                                            player.static_instance[rtcls.staticClass.classid]);
                                    }
                                    else
                                    {
                                        throw new ASRunTimeException("转换Class失败",String.Empty);
                                    }
                                }
                                catch (KeyNotFoundException)
                                {
                                    throw new TypeLinkClassException(type.FullName + " 没有链接到脚本");
                                }
                            }
                            else
                            {
                                throw new ASRunTimeException("没有将Class链接到Type",String.Empty);
                            }
                        }
                        else
                        {
                            var f = ((CSWC)bin).class_Creator[rtCls];
                            f.setLinkObjectValueToSlot(returnSlot,player,obj,rtCls);
                        }
                    }
                }
                else
                {
                    throw new ASRunTimeException("意外的链接类型",String.Empty);
                }
            }
        }