示例#1
0
        public override IoObject proto(IoState state)
        {
            IoCoroutine pro = new IoCoroutine();

            //~//pro.tag.state = state;
            pro.state = state;
            //  pro.tag.cloneFunc = new IoTagCloneFunc(this.clone);
            pro.createSlots();
            pro.createProtos();
            state.registerProtoWithFunc(name, new IoStateProto(name, pro, new IoStateProtoFunc(this.proto)));
            pro.protos.Add(state.protoWithInitFunc("Object"));

            IoCFunction[] methodTable = new IoCFunction[] {
                new IoCFunction("run", new IoMethodFunc(IoCoroutine.slotRun)),
                new IoCFunction("main", new IoMethodFunc(IoCoroutine.slotMain)),
                new IoCFunction("resume", new IoMethodFunc(IoCoroutine.slotResume)),
                new IoCFunction("isCurrent", new IoMethodFunc(IoCoroutine.slotIsCurrent)),
                new IoCFunction("currentCoroutine", new IoMethodFunc(IoCoroutine.slotCurrentCoroutine)),
                new IoCFunction("implementation", new IoMethodFunc(IoCoroutine.slotImplementation)),
                new IoCFunction("setMessageDebugging", new IoMethodFunc(IoCoroutine.slotSetMessageDebugging)),
            };

            pro.addTaglessMethodTable(state, methodTable);
            return(pro);
        }
示例#2
0
        public override IoObject proto(IoState state)
        {
            IoCoroutine pro = new IoCoroutine();
            pro.tag.state = state;
              //  pro.tag.cloneFunc = new IoTagCloneFunc(this.clone);
            pro.createSlots();
            pro.createProtos();
            state.registerProtoWithFunc(name, new IoStateProto(name, pro, new IoStateProtoFunc(this.proto)));
            pro.protos.Add(state.protoWithInitFunc("Object"));

            IoCFunction[] methodTable = new IoCFunction[] {
                new IoCFunction("run", new IoMethodFunc(IoCoroutine.slotRun)),
                new IoCFunction("main", new IoMethodFunc(IoCoroutine.slotMain)),
                new IoCFunction("resume", new IoMethodFunc(IoCoroutine.slotResume)),
                new IoCFunction("isCurrent", new IoMethodFunc(IoCoroutine.slotIsCurrent)),
                new IoCFunction("currentCoroutine", new IoMethodFunc(IoCoroutine.slotCurrentCoroutine)),
                new IoCFunction("implementation", new IoMethodFunc(IoCoroutine.slotImplementation)),
                new IoCFunction("setMessageDebugging", new IoMethodFunc(IoCoroutine.slotSetMessageDebugging)),
            };

            pro.addTaglessMethodTable(state, methodTable);
            return pro;
        }