예제 #1
0
        protected override void Update(GameTime gameTime)
        {
            lastTime = gameTime;
            if (screen != null)
            {
                switch (screen.State)
                {
                case ScreenState.Running:
                    screen.Update(gameTime);
                    break;

                case ScreenState.ChangeNext:
                    screen.OnExit(gameTime);
                    screen = screenList.Next;
                    if (screen != null)
                    {
                        screen.SetRunning();
                        screen.OnEntry(gameTime);
                    }
                    break;

                case ScreenState.ChangePrevious:
                    screen.OnExit(gameTime);
                    screen = screenList.Previous;
                    if (screen != null)
                    {
                        screen.SetRunning();
                        screen.OnEntry(gameTime);
                    }
                    break;

                case ScreenState.ExitApplication:
                    Exit();
                    return;
                }
                base.Update(gameTime);
            }
            else
            {
                Exit();
            }
        }
예제 #2
0
 protected override void Update(GameTime gameTime)
 {
     lastTime = gameTime;
     if(screen != null) {
         switch(screen.State) {
             case ScreenState.Running:
                 screen.Update(gameTime);
                 break;
             case ScreenState.ChangeNext:
                 screen.OnExit(gameTime);
                 screen = screenList.Next;
                 if(screen != null) {
                     screen.SetRunning();
                     screen.OnEntry(gameTime);
                 }
                 break;
             case ScreenState.ChangePrevious:
                 screen.OnExit(gameTime);
                 screen = screenList.Previous;
                 if(screen != null) {
                     screen.SetRunning();
                     screen.OnEntry(gameTime);
                 }
                 break;
             case ScreenState.ExitApplication:
                 Exit();
                 return;
         }
         base.Update(gameTime);
     }
     else {
         Exit();
     }
 }