#region CPL License
/*
Nuclex Framework
Copyright (C) 2002-2011 Nuclex Development Labs
This library is free software; you can redistribute it and/or
modify it under the terms of the IBM Common Public License as
published by the IBM Corporation; either version 1.0 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
IBM Common Public License for more details.
You should have received a copy of the IBM Common Public
License along with this library
*/
#endregion
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Content;
namespace Nuclex.Game.Content {
///
/// Implements the shared content service on top of the Game class' built-in
/// content manager for dependency injection frameworks.
///
public class SharedGameContentManager : ISharedContentService {
/// Initializes a new shared content manager adapter
/// Game the content manager will be taken from
public SharedGameContentManager(Microsoft.Xna.Framework.Game game) {
this.contentManager = game.Content;
}
/// Loads or accesses shared game content
/// Type of the asset to be loaded or accessed
/// Path and name of the requested asset
/// The requested asset from the the shared game content store
public AssetType Load(string assetName) {
return this.contentManager.Load(assetName);
}
/// The content manager this instance delegates to
private ContentManager contentManager;
}
} // namespace Nuclex.Game.Content