Exemplo n.º 1
0
        //needs to insert as a priority queue
        public static TimeEvent Add(TimeEvent.Name name, Command pCommand, float deltaTime)
        {
            Debug.Assert(pCommand != null);

            //real-time systems  must be causal
            //cant have an event occur before current time
            Debug.Assert(deltaTime >= 0.0f);

            TimerMan pTMan = TimerMan.PrivGetInstance();

            Debug.Assert(pTMan != null);

            TimeEvent pTEnode = (TimeEvent)pTMan.GrabNode();

            Debug.Assert(pTEnode != null);

            //the TimeEvent class does the updated trigger time
            pTEnode.Set(name, pCommand, deltaTime);


            Insert(pTEnode);
            return(pTEnode);
        }