IEventDispatcher.cs 880 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace YLBattle
  6. {
  7. /// <summary>
  8. /// 事件操作约束
  9. /// </summary>
  10. public interface IEventDispatcher
  11. {
  12. /// <summary>
  13. /// 创建事件对象
  14. /// </summary>
  15. /// <param name="type">事件类型</param>
  16. /// <returns>事件对象</returns>
  17. FieldEvent MakeEvent(EFieldEventType type);
  18. /// <summary>
  19. /// 事件投递
  20. /// </summary>
  21. /// <param name="ev">事件类型</param>
  22. void PostEvent(FieldEvent ev);
  23. /// <summary>
  24. /// 事件处理注册
  25. /// </summary>
  26. /// <param name="type">事件类型</param>
  27. /// <param name="handle">事件处理器</param>
  28. void RegisterEventHandle(EFieldEventType type, Action<FieldEvent> handle);
  29. }
  30. }