YIUILoopRenderer.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. namespace ET.Client
  3. {
  4. public interface IYIUILoopRenderer
  5. {
  6. /// <summary>
  7. /// 渲染数据项
  8. /// </summary>
  9. /// <param name="self">渲染器实体</param>
  10. /// <param name="item">显示对象</param>
  11. /// <param name="data">数据项</param>
  12. /// <param name="index">数据的索引</param>
  13. /// <param name="select">是否被选中</param>
  14. void Renderer(Entity self, Entity item, object data, int index, bool select);
  15. }
  16. public interface IYIUILoopRenderer<in T1, in T2, in T3> : ISystemType, IYIUILoopRenderer
  17. {
  18. }
  19. [EntitySystem]
  20. public abstract class YIUILoopRendererSystem<T1, T2, T3, T4, T5> : SystemObject, IYIUILoopRenderer<T1, T2, T3>
  21. where T1 : Entity, IYIUIBind, IYIUIInitialize
  22. where T2 : Entity, IYIUIBind, IYIUIInitialize
  23. {
  24. Type ISystemType.Type()
  25. {
  26. return typeof(T1);
  27. }
  28. Type ISystemType.SystemType()
  29. {
  30. return typeof(IYIUILoopRenderer<T1, T2, T3>);
  31. }
  32. void IYIUILoopRenderer.Renderer(Entity self, Entity item, object data, int index, bool select)
  33. {
  34. YIUILoopRenderer((T1)self, (T2)item, (T3)data, index, select);
  35. }
  36. protected abstract void YIUILoopRenderer(T1 self, T2 item, T3 data, int index, bool select);
  37. }
  38. }