Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Measurement.cs
Go to the documentation of this file.
2
4
5public readonly struct Measurement<T> where T : struct
6{
8
10
11 public T Value { get; }
12
14 {
16 Value = value;
17 }
18
20 {
21 _tags = ToArray(tags);
22 Value = value;
23 }
24
26 {
27 if (tags != null)
28 {
29 _tags = new KeyValuePair<string, object>[tags.Length];
30 tags.CopyTo(_tags, 0);
31 }
32 else
33 {
35 }
36 Value = value;
37 }
38
40 {
41 _tags = tags.ToArray();
42 Value = value;
43 }
44
46 {
47 if (tags != null)
48 {
50 }
51 return Instrument.EmptyTags;
52 }
53}
void CopyTo(KeyValuePair< TKey, TValue >[] array, int index)
static KeyValuePair< string, object?>[] EmptyTags
Definition Instrument.cs:11
static KeyValuePair< string, object >[] ToArray(IEnumerable< KeyValuePair< string, object > > tags)
ReadOnlySpan< KeyValuePair< string, object?> > Tags
Definition Measurement.cs:9
readonly KeyValuePair< string, object >[] _tags
Definition Measurement.cs:7
Measurement(T value, IEnumerable< KeyValuePair< string, object?> >? tags)
Measurement(T value, ReadOnlySpan< KeyValuePair< string, object?> > tags)
Measurement(T value, params KeyValuePair< string, object?>[]? tags)