Advertisement
Guest User

Untitled

a guest
Oct 19th, 2011
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1.     public static class GameServices
  2.     {
  3.         private static GameServiceContainer container = new GameServiceContainer();
  4.  
  5.         public static T Get<T>()
  6.         {
  7.             return (T)container.GetService(typeof(T));
  8.         }
  9.  
  10.         public static void Add<T>(T service)
  11.         {
  12.             container.AddService(typeof(T), service);
  13.         }
  14.  
  15.         public static void Remove<T>()
  16.         {
  17.             container.RemoveService(typeof(T));
  18.         }
  19.     }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement