IModules.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using IFramework.Coroutine;
  2. using IFramework.Inject;
  3. using IFramework.Message;
  4. using IFramework.Recorder;
  5. using IFramework.Timer;
  6. using System;
  7. namespace IFramework
  8. {
  9. /// <summary>
  10. /// 模块组
  11. /// </summary>
  12. public interface IModules : IContainer, IBelongToEnvironment
  13. {
  14. /// <summary>
  15. /// 协程
  16. /// </summary>
  17. ICoroutineModule coroutine { get; }
  18. /// <summary>
  19. /// 消息
  20. /// </summary>
  21. IMessageModule message { get; }
  22. /// <summary>
  23. /// 消息(string 版本)
  24. /// </summary>
  25. IStringMessageModule stringMessage { get; }
  26. /// <summary>
  27. /// 操作记录
  28. /// </summary>
  29. IOperationRecorderModule recoder { get; }
  30. /// <summary>
  31. /// 注入模块
  32. /// </summary>
  33. IInjectModule inject { get; }
  34. /// <summary>
  35. /// 计时器
  36. /// </summary>
  37. ITimerModule timer { get; }
  38. /// <summary>
  39. /// 创建模块
  40. /// </summary>
  41. /// <param name="type"></param>
  42. /// <param name="name"></param>
  43. /// <param name="priority"></param>
  44. /// <returns></returns>
  45. Module CreateModule(Type type, string name = Module.defaultName, int priority = 0);
  46. /// <summary>
  47. /// 创建模块
  48. /// </summary>
  49. /// <typeparam name="T"></typeparam>
  50. /// <param name="name"></param>
  51. /// <param name="priority"></param>
  52. /// <returns></returns>
  53. T CreateModule<T>(string name = Module.defaultName, int priority = 0) where T : Module;
  54. /// <summary>
  55. /// 获取模块
  56. /// </summary>
  57. /// <param name="type"></param>
  58. /// <param name="name"></param>
  59. /// <param name="priority"></param>
  60. /// <returns></returns>
  61. Module GetModule(Type type, string name = Module.defaultName, int priority = 0);
  62. /// <summary>
  63. /// 获取模块
  64. /// </summary>
  65. /// <typeparam name="T"></typeparam>
  66. /// <param name="name"></param>
  67. /// <param name="priority"></param>
  68. /// <returns></returns>
  69. T GetModule<T>(string name = Module.defaultName, int priority = 0) where T : Module;
  70. /// <summary>
  71. /// 查找模块
  72. /// </summary>
  73. /// <param name="type"></param>
  74. /// <param name="name"></param>
  75. /// <returns></returns>
  76. Module FindModule(Type type, string name = Module.defaultName);
  77. /// <summary>
  78. /// 查找模块
  79. /// </summary>
  80. /// <typeparam name="T"></typeparam>
  81. /// <param name="name"></param>
  82. /// <returns></returns>
  83. T FindModule<T>(string name = Module.defaultName) where T : Module;
  84. }
  85. }