refactor and moved normal resolver to library (forgot to commit this part last time).

This commit is contained in:
2019-01-21 23:38:25 -06:00
parent 010c66aa0e
commit 1b54dd2d28
3 changed files with 26 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
using Microsoft.Xna.Framework.Content;
using RecrownedAthenaeum.ContentSystem.ContentResolvers;
using RecrownedAthenaeum.ContentSystem;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -19,11 +19,11 @@ namespace RecrownedAthenaeum.ContentSystem
/// <summary>
/// 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.
/// </summary>
public readonly Dictionary<Type, IContentPathModifier> contentPathModifier;
public readonly Dictionary<Type, IContentPathResolver> contentPathModifier;
/// <summary>
/// Used when no path modifier is defined for that specific type.
/// </summary>
public IContentPathModifier normalPathModifier = new NormalContentResolver();
public IContentPathResolver normalPathModifier = new NormalContentResolver();
volatile float progress;
volatile bool running;
@@ -46,7 +46,7 @@ namespace RecrownedAthenaeum.ContentSystem
this.contentManager = contentManager;
assets = new Dictionary<string, IDisposable>();
queue = new Queue<ContentData>();
contentPathModifier = new Dictionary<Type, IContentPathModifier>();
contentPathModifier = new Dictionary<Type, IContentPathResolver>();
}
private void Load(string assetName, Type type, bool usePathModifier)
@@ -55,7 +55,7 @@ namespace RecrownedAthenaeum.ContentSystem
string path = assetName;
if (usePathModifier)
{
IContentPathModifier handler;
IContentPathResolver handler;
if (contentPathModifier.ContainsKey(type))
{
handler = contentPathModifier[type];