Esempio n. 1
0
        public static void _doSetThisItem(ASBinCode.rtData.rtObjectBase thisObj,ASBinCode.rtti.ClassMember set_this_item,
                                          RunTimeValueBase v,RunTimeValueBase index,StackSlot slot,StackFrame frame,OpStep step
                                          )
        {
            //***读取setter***
            RunTimeValueBase func;

            func = ((MethodGetterBase)set_this_item.bindField).getMethod(
                thisObj
                );

            //***调用设置器***

            var funCaller = frame.player.funcCallerPool.create(frame,step.token);

            funCaller.SetFunction((ASBinCode.rtData.rtFunction)func); ((ASBinCode.rtData.rtFunction)func).Clear();
            funCaller.loadDefineFromFunction();
            if (!funCaller.createParaScope())
            {
                return;
            }

            //funCaller.releaseAfterCall = true;

            bool success;

            funCaller.pushParameter(v,0,out success);

            if (!success)
            {
                frame.endStep(step);
                return;
            }

            funCaller.pushParameter(index,1,out success);
            if (!success)
            {
                frame.endStep(step);
                return;
            }

            funCaller._tempSlot  = frame._tempSlot1;
            funCaller.returnSlot = frame._tempSlot1;

            BlockCallBackBase cb = frame.player.blockCallBackPool.create();

            cb.setCallBacker(_setthisitem_callbacker);
            cb.step = step;
            cb.args = frame;


            funCaller.callbacker = cb;
            funCaller.call();

            return;
        }
Esempio n. 2
0
        public static ClassMember LoadClassMember(BinaryReader reader, CSWCSerizlizer serizlizer, IDictionary <int, object> serizlized, int key)
        {
            ///// <summary>
            ///// 成员名
            ///// </summary>
            //public string name;
            string name = reader.ReadString();

            ClassMember classMember = new ClassMember(); serizlized.Add(key, classMember);

            classMember.name = name;
            Class refClass = serizlizer.DeserializeObject <Class>(reader, Class.LoadClass
                                                                  );
            //public readonly IMember bindField;
            IMember bindField = (IMember)serizlizer.DeserializeObject <ISWCSerializable>(reader, ISWCSerializableLoader.LoadIMember
                                                                                         );



            classMember.refClass  = refClass;
            classMember.bindField = bindField;


            //public bool isPublic;
            classMember.isPublic = reader.ReadBoolean();
            //public bool isInternal;
            classMember.isInternal = reader.ReadBoolean();
            //public bool isPrivate;
            classMember.isPrivate = reader.ReadBoolean();
            //public bool isProtectd;
            classMember.isProtectd = reader.ReadBoolean();

            ///// <summary>
            ///// 是否属性读取器
            ///// </summary>
            //public bool isGetter;
            classMember.isGetter = reader.ReadBoolean();
            ///// <summary>
            ///// 是否属性设置器
            ///// </summary>
            //public bool isSetter;
            classMember.isSetter = reader.ReadBoolean();

            ///// <summary>
            ///// 是否覆盖基类方法
            ///// </summary>
            //public bool isOverride;
            classMember.isOverride = reader.ReadBoolean();

            //public bool isFinal;
            classMember.isFinal = reader.ReadBoolean();

            ///// <summary>
            ///// 是否是静态成员
            ///// </summary>
            //public bool isStatic;
            classMember.isStatic = reader.ReadBoolean();
            ///// <summary>
            ///// 是否是常量
            ///// </summary>
            //public bool isConst;
            classMember.isConst = reader.ReadBoolean();
            ///// <summary>
            ///// 是否是构造函数
            ///// </summary>
            //public bool isConstructor;
            classMember.isConstructor = reader.ReadBoolean();

            ///// <summary>
            ///// 成员字面值,比如1000,"aabc"等确定的字面值
            ///// </summary>
            //public RunTimeValueBase defaultValue;
            classMember.defaultValue = serizlizer.DeserializeObject <RunTimeValueBase>(reader, RunTimeValueBase.LoadRunTimeValueBase);

            ///// <summary>
            ///// 从哪个类继承而来
            ///// </summary>
            //public Class inheritFrom;
            classMember.inheritFrom = serizlizer.DeserializeObject <Class>(reader, Class.LoadClass);

            ///// <summary>
            ///// 继承源
            ///// </summary>
            //public ClassMember inheritSrcMember;
            classMember.inheritSrcMember = serizlizer.DeserializeObject <ClassMember>(reader, ClassMember.LoadClassMember);

            //public ClassMember virtualLink;
            classMember.virtualLink = serizlizer.DeserializeObject <ClassMember>(reader, ClassMember.LoadClassMember);
            //public Class virtualLinkFromClass;
            //classMember.virtualLinkFromClass = serizlizer.DeserializeObject<Class>(reader, Class.LoadClass);

            //classMember.overridedMember = serizlizer.DeserializeObject<ClassMember>(reader, ClassMember.LoadClassMember);

            //private RunTimeDataType _type;
            classMember._type = reader.ReadInt32();


            return(classMember);
        }