Example #1
0
        //----------------------------------------------------------------------------------
        /// <summary>
        /// allows for registering a new system.
        /// </summary>
        /// <typeparam name="TISystemsType">the type of the service to be registered.</typeparam>
        /// <param name="provider">the service provider.</param>
        //----------------------------------------------------------------------------------
        public static void RegisterSystems <TISystemsType>(ISystems provider) where TISystemsType : ISystems
        {
            Type type = provider.GetType();

            LazyInit();

            if (!m_services.ContainsKey(type))
            {
                m_services.Add(typeof(TISystemsType), provider);
            }
            else
            {
                Debug.Fail("This service already exists!");
            }
        }