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.
54 lines
1.0 KiB
54 lines
1.0 KiB
using System;
|
|
using System.Collections;
|
|
|
|
namespace Unity.Collections
|
|
{
|
|
internal struct Pair<Key, Value>
|
|
{
|
|
public Key key;
|
|
public Value value;
|
|
public Pair(Key k, Value v)
|
|
{
|
|
key = k;
|
|
value = v;
|
|
}
|
|
|
|
#if !NET_DOTS
|
|
public override string ToString()
|
|
{
|
|
return $"{key} = {value}";
|
|
}
|
|
|
|
#endif
|
|
}
|
|
|
|
// Tiny does not contains an IList definition (or even ICollection)
|
|
#if !NET_DOTS
|
|
internal struct ListPair<Key, Value> where Value : IList
|
|
{
|
|
public Key key;
|
|
public Value value;
|
|
|
|
public ListPair(Key k, Value v)
|
|
{
|
|
key = k;
|
|
value = v;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
String result = $"{key} = [";
|
|
for (var v = 0; v < value.Count; ++v)
|
|
{
|
|
result += value[v];
|
|
if (v < value.Count - 1)
|
|
result += ", ";
|
|
}
|
|
|
|
result += "]";
|
|
return result;
|
|
}
|
|
}
|
|
#endif
|
|
}
|