rendered paste bodyusing System;
using System.Collections.Generic;
using System.Text;
namespace FlatRedBall
{
public class FlatRedBallServices
{
private static Dictionary<Type, object> mPool;
static FlatRedBallServices()
{
mPool = new Dictionary<Type, object>();
}
public static void RegisterService(object service)
{
Type t = service.GetType();
RegisterService(t, service);
}
public static void RegisterService<T>(object service)
{
RegisterService(typeof(T), service);
}
public static void RegisterService(Type t, object service)
{
if (!mPool.ContainsKey(t))
{
mPool.Add(t, service);
}
}
public static T GetService<T>()
{
if(mPool.Contains(typeof(t))
return (T)mPool[typeof(T)];
else
return null;
}
}
}