Esempio n. 1
0
    public static int Add(int delay, int cycle, Func <bool> handler)
    {
        Timer tm = new Timer();

        tm.sn      = ++nextSn;
        tm.cycle   = cycle;
        tm.handler = handler;
        instance.mapSnTimer [tm.sn] = tm;
        instance.Add(now() + delay, tm);
        return(tm.sn);
    }
Esempio n. 2
0
        protected void delayFinish(AICtrl agent, State stat)
        {
            Action a = () =>
            {
                this.state = stat;
                Action b = () =>
                {
                    if (this.parent != null)
                    {
                        this.parent.tryMoveNext(agent, stat);
                    }
                };
                TimerMng.Add(Delay, b);
            };

            TimerMng.Add(Delay, a);
        }