Ejemplo n.º 1
0
        /// <summary>
        /// Hard refresh - Remove all subscribers except the game manager
        /// Soft refresh - Remove all subscribers that are NOT flagged as persistant listeners
        ///                (ie. appstate, board)
        /// After refresh, gather tree from root component and re-subscribe all components
        /// </summary>
        public void RefreshTree(bool hardRefresh)
        {
            if (hardRefresh)
            {
                EventManager.ClearListeners();
            }
            else
            {
                EventManager.ClearFlaggedListeners();
            }

            components = root.BuildTree();

            foreach (BaseComplexComponent component in components)
            {
                EventManager.Subscribe(component);
            }
        }