public GameAsset Load(string name) { if (string.IsNullOrEmpty(name)) { return(null); } GameAsset result = null; if (assets.TryGetValue(name, out result)) { return(result); } else { foreach (AssetProvider item in providers) { result = item.Load(name); if (result != null) { return(result); } } return(null); } }
public void Store(string name, GameAsset asset) { if (string.IsNullOrEmpty(name) || asset == null) { return; } assets[name] = asset; }
public void Write(GameAsset asset) { string name = Storage.FindName(asset); if (string.IsNullOrEmpty(name) == false) { this.WriteURI(name); } else { this.WriteURI(string.Empty); } }
public string FindName(GameAsset asset) { if (asset == null) { return(null); } foreach (var item in assets) { if (item.Value == asset) { return(item.Key); } } return(null); }
public abstract GameAsset Read(AssetStreamReader reader, GameAsset existingInstance);