Miscellany
public text v1 · immutableusing System;
using System.Collections.Generic;
using System.Text;
namespace FlatRedBall
{
class FlatRedBallServices
{
private static Dictionary mPool;
static FlatRedBallServices()
{
mPool = new Dictionary();
}
public static void RegisterService(object service)
{
Type t = service.GetType();
if (!mPool.ContainsKey(t))
{
mPool.Add(t, service);
}
}
public static T GetService()
{
return (T)mPool[typeof(T)];
}
}
}