Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
UniqueList.cs
Go to the documentation of this file.
1
using
System.Collections.Generic
;
2
3
namespace
System.Xml.Xsl.IlGen
;
4
5
internal
sealed
class
UniqueList
<T>
6
{
7
private
readonly
Dictionary<T, int>
_lookup
=
new
Dictionary<T, int>
();
8
9
private
readonly
List<T>
_list
=
new
List<T>
();
10
11
public
int
Add
(T
value
)
12
{
13
int
num;
14
if
(!
_lookup
.
ContainsKey
(
value
))
15
{
16
num =
_list
.Count;
17
_lookup
.
Add
(
value
, num);
18
_list
.Add(
value
);
19
}
20
else
21
{
22
num =
_lookup
[
value
];
23
}
24
return
num;
25
}
26
27
public
T[]
ToArray
()
28
{
29
return
_list
.ToArray();
30
}
31
}
System.Collections.Generic.Dictionary.ContainsKey
bool ContainsKey(TKey key)
Definition
Dictionary.cs:917
System.Collections.Generic.Dictionary.Add
void Add(TKey key, TValue value)
Definition
Dictionary.cs:873
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.Xml.Xsl.IlGen.UniqueList._list
readonly List< T > _list
Definition
UniqueList.cs:9
System.Xml.Xsl.IlGen.UniqueList._lookup
readonly Dictionary< T, int > _lookup
Definition
UniqueList.cs:7
System.Xml.Xsl.IlGen.UniqueList.ToArray
T[] ToArray()
Definition
UniqueList.cs:27
System.Xml.Xsl.IlGen.UniqueList.Add
int Add(T value)
Definition
UniqueList.cs:11
System.Xml.Xsl.IlGen.UniqueList
Definition
UniqueList.cs:6
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Xml.Xsl.IlGen
Definition
BranchingContext.cs:1
System.ExceptionArgument.value
@ value
source
System.Private.Xml
System.Xml.Xsl.IlGen
UniqueList.cs
Generated by
1.10.0