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

◆ CreateUntracked< T >()

Asset< T > ReLogic.Content.AssetRepository.CreateUntracked< T > ( Stream stream,
string name,
AssetRequestMode mode = AssetRequestMode::ImmediateLoad )
inline

Implements ReLogic.Content.IAssetRepository.

Type Constraints
T :class 

Definition at line 361 of file AssetRepository.cs.

361 : class
362 {
363 string ext = Path.GetExtension(name);
364 if (!_readers.TryGetReader(ext, out var reader))
365 {
366 throw AssetLoadException.FromMissingReader(ext);
367 }
368 int length = ext.Length;
369 Asset<T> asset = new Asset<T>(name.Substring(0, name.Length - length));
370 Task loadTask = LoadUntracked(stream, reader, asset, mode);
371 asset.Wait = delegate
372 {
374 };
375 if (mode == AssetRequestMode.ImmediateLoad)
376 {
377 asset.Wait();
378 }
379 return asset;
380 }
bool TryGetReader(string extension, out IAssetReader reader)
readonly AssetReaderCollection _readers
static ? string GetExtension(string? path)
Definition Path.cs:168

References ReLogic.Content.AssetRepository._readers, ReLogic.Content.AssetLoadException.FromMissingReader(), System.IO.Path.GetExtension(), System.length, System.stream, and ReLogic.Content.AssetReaderCollection.TryGetReader().