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

◆ SetAssetNames()

void ReLogic.Content.Sources.ContentSource.SetAssetNames ( IEnumerable< string > paths)
inlineprotectedinherited

Definition at line 19 of file ContentSource.cs.

20 {
21 assetPaths = paths.ToArray();
23 string[] array = assetPaths;
24 foreach (string obj in array)
25 {
26 string ext = Path.GetExtension(obj);
27 string text = obj;
28 int length = ext.Length;
29 string name = AssetPathHelper.CleanPath(text.Substring(0, text.Length - length));
31 {
32 throw new Exception($"Multiple extensions for asset {name}, ({ext}, {ext2})");
33 }
35 }
36 }
Dictionary< string, string > assetExtensions
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
static ? string GetExtension(string? path)
Definition Path.cs:168

References System.array, ReLogic.Content.Sources.ContentSource.assetExtensions, ReLogic.Content.Sources.ContentSource.assetPaths, ReLogic.Content.AssetPathHelper.CleanPath(), System.Collections.Generic.Dictionary< TKey, TValue >.Clear(), System.IO.Path.GetExtension(), System.length, System.obj, System.text, and System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue().

Referenced by ReLogic.Content.Sources.FileSystemContentSource.FileSystemContentSource(), ReLogic.Content.Sources.XnaDirectContentSource.XnaDirectContentSource(), and ReLogic.Content.Sources.ZipContentSource.BuildEntryList().