diff --git a/RecrownedGTK/src/AssetsSystem/AssetLoader.cs b/RecrownedGTK/src/AssetsSystem/AssetLoader.cs new file mode 100644 index 0000000..b14e620 --- /dev/null +++ b/RecrownedGTK/src/AssetsSystem/AssetLoader.cs @@ -0,0 +1,8 @@ +namespace RecrownedGTK.AssetsSystem { + public class AssetLoader { + public T Load(string path) { + throw new System.NotImplementedException(); + //TODO Implement a method of loading. + } + } +} \ No newline at end of file diff --git a/RecrownedGTK/src/AssetsSystem/AssetManager.cs b/RecrownedGTK/src/AssetsSystem/AssetManager.cs index 4f5456a..831cc04 100644 --- a/RecrownedGTK/src/AssetsSystem/AssetManager.cs +++ b/RecrownedGTK/src/AssetsSystem/AssetManager.cs @@ -10,10 +10,10 @@ namespace RecrownedGTK.AssetsSystem /// public class AssetManager { + private AssetLoader assetLoader; Thread thread; - readonly AssetManager contentManager; readonly Queue queue; - Dictionary assets; + Dictionary assets; /// /// Path modifiers to change the path in which the content manager looks to load a file. Used for better organizing things while not needing to type entire path. /// @@ -41,7 +41,7 @@ namespace RecrownedGTK.AssetsSystem /// The manager to wrap. public AssetManager() { - assets = new Dictionary(); + assets = new Dictionary(); queue = new Queue(); contentPathModifier = new Dictionary(); } @@ -77,7 +77,7 @@ namespace RecrownedGTK.AssetsSystem } path = handler.Modify(assetName); } - assets.Add(assetName, contentManager.Load(path)); + assets.Add(assetName, assetLoader.Load(path)); } @@ -184,7 +184,10 @@ namespace RecrownedGTK.AssetsSystem { lock (queue) { - contentManager.Unload(); + foreach (KeyValuePair asset in assets) + { + asset.Value.Dispose(); + } assets.Clear(); ClearQueue(); Debug.WriteLine("Unloaded all assets.");