EQueue.cs 522 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace Model
  4. {
  5. public class EQueue<T>: IEnumerable
  6. {
  7. private readonly Queue<T> list = new Queue<T>();
  8. public void Enqueue(T t)
  9. {
  10. this.list.Enqueue(t);
  11. }
  12. public T Dequeue()
  13. {
  14. T t = this.list.Dequeue();
  15. return t;
  16. }
  17. public int Count
  18. {
  19. get
  20. {
  21. return this.list.Count;
  22. }
  23. }
  24. public IEnumerator GetEnumerator()
  25. {
  26. return this.list.GetEnumerator();
  27. }
  28. public void Clear()
  29. {
  30. this.list.Clear();
  31. }
  32. }
  33. }