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(); } }
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(); } }