Пример #1
0
        public void DirectCall(HandlerType handlerType)
        {
            MsgHandlerBase handler = null;
            MsgBase        m       = null;

            switch (handlerType)
            {
            case HandlerType.Chief:
                handler = new PoliceChief("MacMahon");
                m       = new ChiefMsg();
                break;

            case HandlerType.Patrol:
                handler = new PolicePatrol("Car102");
                m       = new PatrolMsg();
                break;
            }

            Clock.Timer.Restart();
            handler.ReferencePoint(m);

            // clean up instance
            handler.UnregisterHandlers();
            handler = null;
        }
Пример #2
0
 /// <summary>
 /// 注册消息
 /// </summary>
 protected void RegMsg(int msgId)
 {
     if (MsgHandler == null)
     {
         MsgHandler = new MsgHandlerBase(this, this);
     }
     MsgHandler.AddMsgId(msgId);
 }
Пример #3
0
 public void CallbackFromCar209AboutHiSpeedPursuit(string msg)
 {
     Clock.Timer.Stop();
     MsgHandlerBase.TraceLog(MsgType.Callback, SenderType.Patrol, HandlerType.PoliceHQ, "Dispatcher");
 }