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; }
/// <summary> /// 注册消息 /// </summary> protected void RegMsg(int msgId) { if (MsgHandler == null) { MsgHandler = new MsgHandlerBase(this, this); } MsgHandler.AddMsgId(msgId); }
public void CallbackFromCar209AboutHiSpeedPursuit(string msg) { Clock.Timer.Stop(); MsgHandlerBase.TraceLog(MsgType.Callback, SenderType.Patrol, HandlerType.PoliceHQ, "Dispatcher"); }