Esempio n. 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);
        }
Esempio n. 2
0
        public override IoObject clone(IoState state)
        {
            IoCoroutine proto  = state.protoWithInitFunc(name) as IoCoroutine;
            IoCoroutine result = new IoCoroutine();

            uniqueIdCounter++;
            result.uniqueId = uniqueIdCounter;
            result.tag      = proto.tag;
            result.createProtos();
            result.createSlots();
            result.protos.Add(proto);
            return(result);
        }
Esempio n. 3
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;
        }
Esempio n. 4
0
 public override IoObject clone(IoState state)
 {
     IoCoroutine proto = state.protoWithInitFunc(name) as IoCoroutine;
     IoCoroutine result = new IoCoroutine();
     uniqueIdCounter++;
     result.uniqueId = uniqueIdCounter;
     result.tag = proto.tag;
     result.createProtos();
     result.createSlots();
     result.protos.Add(proto);
     return result;
 }