ActorMessageDispatherComponent.cs 613 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Collections.Generic;
  3. namespace ETModel
  4. {
  5. /// <summary>
  6. /// Actor消息分发组件
  7. /// </summary>
  8. public class ActorMessageDispatherComponent : Component
  9. {
  10. public readonly Dictionary<string, IActorTypeHandler> ActorTypeHandlers = new Dictionary<string, IActorTypeHandler>();
  11. public readonly Dictionary<Type, IMActorHandler> ActorMessageHandlers = new Dictionary<Type, IMActorHandler>();
  12. public override void Dispose()
  13. {
  14. if (this.IsDisposed)
  15. {
  16. return;
  17. }
  18. base.Dispose();
  19. this.ActorMessageHandlers.Clear();
  20. this.ActorTypeHandlers.Clear();
  21. }
  22. }
  23. }