Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
IAssetManager.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System.IO;
4 using System.Threading.Tasks;
5 using SiliconStudio.Core.IO;
6 
7 namespace SiliconStudio.Core.Serialization.Assets
8 {
9  /// <summary>
10  /// Interface of the asset manager.
11  /// </summary>
12  public interface IAssetManager
13  {
14  /// <summary>
15  /// Opens the specified URL as a stream used for custom raw asset loading.
16  /// </summary>
17  /// <param name="url">The URL to the raw asset.</param>
18  /// <param name="streamFlags">The type of stream needed</param>
19  /// <returns>A stream to the raw asset.</returns>
20  Stream OpenAsStream(string url, StreamFlags streamFlags = StreamFlags.None);
21 
22  /// <summary>
23  /// Loads content from the specified URL.
24  /// </summary>
25  /// <typeparam name="T">The content type.</typeparam>
26  /// <param name="url">The URL to load from.</param>
27  /// <param name="settings">The settings. If null, fallback to <see cref="AssetManagerLoaderSettings.Default"/>.</param>
28  /// <returns></returns>
29  T Load<T>(string url, AssetManagerLoaderSettings settings = null) where T : class;
30 
31  /// <summary>
32  /// Loads content from the specified URL asynchronously.
33  /// </summary>
34  /// <typeparam name="T">The content type.</typeparam>
35  /// <param name="url">The URL to load from.</param>
36  /// <param name="settings">The settings. If null, fallback to <see cref="AssetManagerLoaderSettings.Default"/>.</param>
37  /// <returns></returns>
38  Task<T> LoadAsync<T>(string url, AssetManagerLoaderSettings settings = null) where T : class;
39 
40  /// <summary>
41  /// Unloads the specified object.
42  /// </summary>
43  /// <param name="obj">The object to unload.</param>
44  void Unload(object obj);
45 
46  /// <summary>
47  /// Gets the serializer.
48  /// </summary>
49  /// <value>The serializer.</value>
50  AssetSerializer Serializer { get; }
51  }
52 }
Specifies settings for AssetManager.Load{T} operations.
StreamFlags
Describes the different type of streams.
Definition: StreamFlags.cs:11