/// <summary>
        ///		Removes the given event game process from the process list so it no 
        ///		longer gets called when RunProcesses is called.
        /// </summary>
        /// <param name="process">Process to dettach.</param>
        public static void DettachProcess(Process process)
        {
            _processList.Remove(process);
            process.Dettached();
            process.Active = false;

            // Sort list based on priority. (Ech, slow).
            _processList.Sort();
        }
 /// <summary>
 ///		Stops this process executing until the given process completed with the correct result.
 /// </summary>
 /// <param name="process">Process to wait for.</param>
 /// <param name="result">Result to wait for.</param>
 public virtual void WaitForProcess(Process process, ProcessResult result)
 {
     _waitingForProcess = true;
     _waitForProcess = process;
     _waitForResult = result;
 }
        /// <summary>
        ///		Attachs a given game process to the process list so it will be
        ///		called when RunProcesses is called.
        /// </summary>
        /// <param name="process">Process to attach.</param>
        public static void AttachProcess(Process process)
        {
            if (_processList.Contains(process)) return;
            _processList.Add(process);
            process.Attached();
            process.Active = true;

            // Sort list based on priority. (Ech, slow).
            _processList.Sort();
        }
 /// <summary>
 ///		Cancels a process wait caused by called WaitForProcess.
 /// </summary>
 public virtual void CancelProcessWait()
 {
     _waitingForProcess = false;
     _waitForResult = 0;
     _waitForProcess = null;
 }