Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetExtension()

string ReLogic.Content.Sources.ContentSource.GetExtension ( string assetName)
inlineinherited

Must be threadsafe!

Returns
null if the asset does not exist

Implements ReLogic.Content.Sources.IContentSource.

Definition at line 43 of file ContentSource.cs.

44 {
45 if (!assetExtensions.TryGetValue(AssetPathHelper.CleanPath(assetName), out var ext))
46 {
47 return null;
48 }
49 return ext;
50 }
Dictionary< string, string > assetExtensions
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)

References ReLogic.Content.Sources.ContentSource.assetExtensions, ReLogic.Content.AssetPathHelper.CleanPath(), and System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue().