Nenhuma descrição
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

DebugView.cs 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections;
  3. namespace Unity.Collections
  4. {
  5. internal struct Pair<Key, Value>
  6. {
  7. public Key key;
  8. public Value value;
  9. public Pair(Key k, Value v)
  10. {
  11. key = k;
  12. value = v;
  13. }
  14. public override string ToString()
  15. {
  16. return $"{key} = {value}";
  17. }
  18. }
  19. // Tiny does not contains an IList definition (or even ICollection)
  20. internal struct ListPair<Key, Value> where Value : IList
  21. {
  22. public Key key;
  23. public Value value;
  24. public ListPair(Key k, Value v)
  25. {
  26. key = k;
  27. value = v;
  28. }
  29. public override string ToString()
  30. {
  31. String result = $"{key} = [";
  32. for (var v = 0; v < value.Count; ++v)
  33. {
  34. result += value[v];
  35. if (v < value.Count - 1)
  36. result += ", ";
  37. }
  38. result += "]";
  39. return result;
  40. }
  41. }
  42. }