Ejemplo n.º 1
0
        /* Function: AddStartupIssues
         *
         * Called *during engine startup only* to set one or more <StartupIssueFlags>.  These are combined with the existing
         * <StartupIssues> rather than replacing them, which means flags can be set but they cannot be cleared.  More than one can
         * be set in a single call so you can pass a combination of flags.  If any of them weren't previously set it will notify the
         * <IStartupWatchers> of the changes.
         *
         * You can pass one startup watcher to not be notified, which can be used to prevent a module from receiving its own notification.
         * If that notification leads to other startup issues being added it will still receive those later notifications.
         */
        public void AddStartupIssues(StartupIssues newIssues, IStartupWatcher dontNotify = null)
        {
            StartupIssues oldIssues      = this.startupIssues;
            StartupIssues combinedIssues = (oldIssues | newIssues);

            if (combinedIssues != oldIssues)
            {
                StartupIssues changedIssues = (combinedIssues & ~oldIssues);

                this.startupIssues = combinedIssues;

                foreach (var watcher in startupWatchers)
                {
                    if (watcher != dontNotify)
                    {
                        watcher.OnStartupIssues(changedIssues, combinedIssues);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        // Group: Startup Event Functions
        // __________________________________________________________________________


        /* Function: AddStartupWatcher
         * Adds an object that wants to be aware of events that occur during initialization.  Call after <Create()> but before <Start()>.
         */
        public void AddStartupWatcher(IStartupWatcher watcher)
        {
            startupWatchers.Add(watcher);
        }