暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DebugView.cs 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #if !NET_DOTS
  15. public override string ToString()
  16. {
  17. return $"{key} = {value}";
  18. }
  19. #endif
  20. }
  21. // Tiny does not contains an IList definition (or even ICollection)
  22. #if !NET_DOTS
  23. internal struct ListPair<Key, Value> where Value : IList
  24. {
  25. public Key key;
  26. public Value value;
  27. public ListPair(Key k, Value v)
  28. {
  29. key = k;
  30. value = v;
  31. }
  32. public override string ToString()
  33. {
  34. String result = $"{key} = [";
  35. for (var v = 0; v < value.Count; ++v)
  36. {
  37. result += value[v];
  38. if (v < value.Count - 1)
  39. result += ", ";
  40. }
  41. result += "]";
  42. return result;
  43. }
  44. }
  45. #endif
  46. }