Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AssetReaderCollection.cs
Go to the documentation of this file.
1
using
System.Collections.Generic
;
2
using
System.Linq
;
3
using
ReLogic.Content.Readers
;
4
5
namespace
ReLogic.Content
;
6
7
public
class
AssetReaderCollection
8
{
9
private
readonly
Dictionary<string, IAssetReader>
_readersByExtension
=
new
Dictionary<string, IAssetReader>
();
10
11
private
string
[]
_extensions
;
12
13
public
void
RegisterReader
(
IAssetReader
reader,
params
string
[]
extensions
)
14
{
15
foreach
(
string
text
in
extensions
)
16
{
17
_readersByExtension
[text.ToLower()] = reader;
18
}
19
_extensions
=
_readersByExtension
.
Keys
.ToArray();
20
}
21
22
public
bool
TryGetReader
(
string
extension
,
out
IAssetReader
reader)
23
{
24
return
_readersByExtension
.
TryGetValue
(
extension
.ToLower(),
out
reader);
25
}
26
27
public
string
[]
GetSupportedExtensions
()
28
{
29
return
_extensions
;
30
}
31
}
ReLogic.Content.AssetReaderCollection._extensions
string[] _extensions
Definition
AssetReaderCollection.cs:11
ReLogic.Content.AssetReaderCollection.RegisterReader
void RegisterReader(IAssetReader reader, params string[] extensions)
Definition
AssetReaderCollection.cs:13
ReLogic.Content.AssetReaderCollection.TryGetReader
bool TryGetReader(string extension, out IAssetReader reader)
Definition
AssetReaderCollection.cs:22
ReLogic.Content.AssetReaderCollection.GetSupportedExtensions
string[] GetSupportedExtensions()
Definition
AssetReaderCollection.cs:27
ReLogic.Content.AssetReaderCollection._readersByExtension
readonly Dictionary< string, IAssetReader > _readersByExtension
Definition
AssetReaderCollection.cs:9
ReLogic.Content.AssetReaderCollection
Definition
AssetReaderCollection.cs:8
System.Collections.Generic.Dictionary.TryGetValue
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Definition
Dictionary.cs:1419
System.Collections.Generic.Dictionary.Keys
KeyCollection Keys
Definition
Dictionary.cs:684
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
ReLogic.Content.Readers.IAssetReader
Definition
IAssetReader.cs:8
ReLogic.Content.Readers
Definition
IAssetReader.cs:5
ReLogic.Content
Definition
IAssetReader.cs:5
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Linq
Definition
ImmutableArrayExtensions.cs:4
source
ReLogic
ReLogic.Content
AssetReaderCollection.cs
Generated by
1.10.0