axiosengine/axios/Engine/GameServices.cs
Nathan Adams 67ab74899f Removing cache from Gleed2D as ContentManager automatically does this
Adding cache
Adding XOR Shift random class
2014-12-30 22:07:05 -06:00

40 lines
956 B
C#

using Microsoft.Xna.Framework;
namespace Axios.Engine
{
public static class GameServices
{
private static GameServiceContainer container;
private static object lockobj = new object();
public static GameServiceContainer Instance
{
get
{
lock (GameServices.lockobj)
{
if (container == null)
{
container = new GameServiceContainer();
}
}
return container;
}
}
public static T GetService<T>()
{
return (T)Instance.GetService(typeof(T));
}
public static void AddService<T>(T service)
{
Instance.AddService(typeof(T), service);
}
public static void RemoveService<T>()
{
Instance.RemoveService(typeof(T));
}
}
}