/// <summary>
        /// 注册游戏框架组件。
        /// </summary>
        /// <param name="gameFrameworkComponent">要注册的游戏框架组件。</param>
        internal static void RegisterComponent(GameFrameworkComponent gameFrameworkComponent)
        {
            if (gameFrameworkComponent == null)
            {
                Log.Error("Game Framework component is invalid.");
                return;
            }

            Type type = gameFrameworkComponent.GetType();

            LinkedListNode <GameFrameworkComponent> current = s_GameFrameworkComponents.First;

            while (current != null)
            {
                if (current.Value.GetType() == type)
                {
                    Log.Error("Game Framework component type '{0}' is already exist.", type.FullName);
                    return;
                }

                current = current.Next;
            }

            s_GameFrameworkComponents.AddLast(gameFrameworkComponent);
        }
Example #2
0
        internal static void RegisterComponent(GameFrameworkComponent gameFrameworkComponent)
        {
            Type type = gameFrameworkComponent.GetType();

            LinkedListNode <GameFrameworkComponent> current = s_GameFrameworkComponents.First;

            while (current != null)
            {
                if (current.Value.GetType() == type)
                {
                    Log.Error();
                    return;
                }
                current = current.Next;
            }
            s_GameFrameworkComponents.AddLast(gameFrameworkComponent);
        }
Example #3
0
        /// <summary>
        /// 注册游戏框架组件。
        /// </summary>
        /// <param name="gameFrameworkComponent">要注册的游戏框架组件。</param>
        internal static void RegisterComponent(GameFrameworkComponent gameFrameworkComponent)
        {
            if (gameFrameworkComponent == null)
            {
                throw new GameFrameworkException("Game framework component is invalid.");
            }

            Type type = gameFrameworkComponent.GetType();

            foreach (GameFrameworkComponent component in s_GameFrameworkComponents)
            {
                if (component.GetType() == type)
                {
                    throw new GameFrameworkException(string.Format("Game framework component type '{0}' is already exist.", type.FullName));
                }
            }

            s_GameFrameworkComponents.AddLast(gameFrameworkComponent);
        }