Ejemplo n.º 1
0
        static void UpdateSelectedPlugIn(float currentTime, float elapsedTime)
        {
            // switch to Update phase
            PushPhase(Phase.Update);

            // service queued reset request, if any
            DoDelayedResetPlugInXXX();

            // if no vehicle is selected, and some exist, select the first one
            if (SelectedVehicle == null)
            {
                IVehicle[] all = AllVehiclesOfSelectedPlugIn().ToArray();
                if (all.Length > 0)
                {
                    SelectedVehicle = all[0];
                }
            }

            // invoke selected PlugIn's Update method
            _selectedPlugIn.Update(currentTime, elapsedTime);

            // return to previous phase
            PopPhase();
        }