ListComponent.cs 323 B

123456789101112131415
  1. namespace KYFramework;
  2. public class ListComponent<T>: List<T>, IDisposable
  3. {
  4. public static ListComponent<T> Create()
  5. {
  6. return Game.ObjectPool.Fetch(typeof (ListComponent<T>)) as ListComponent<T>;
  7. }
  8. public void Dispose()
  9. {
  10. this.Clear();
  11. Game.ObjectPool.Recycle(this);
  12. }
  13. }