// ----------------- // // ----| To-Do |---- // // ----------------- // #region To-Do public static void UnloadGame(Game game, MainWindow mainWindow) { var gameView = mainWindow.Index.Content as GameView; Timer.Stop(); mainWindow.KeyDown -= delegate(object s, KeyEventArgs e) { KeyEvents.OnKeyDown(s, e, game); }; mainWindow.KeyUp -= delegate(object s, KeyEventArgs e) { KeyEvents.OnKeyUp(s, e, game); }; Timer.Tick -= delegate(object s, EventArgs e) { TimerEvent.OnTick(s, e, game); }; Break(game, gameView.ScrollView, gameView.GameCanvas); }
public static void LoadGame(Game game, MainWindow mainWindow) { IndexHelper.SetIndex("LoadingScreen"); var gameView = new GameView(); Build(game, gameView.ScrollView, gameView.GameCanvas); gameView.GameCanvas.Children.Add(game.Person.Control); game.Person = game.Person; IndexHelper.SetIndex(gameView); Timer.Tick += delegate(object s, EventArgs e) { TimerEvent.OnTick(s, e, game); }; mainWindow.KeyDown += delegate(object s, KeyEventArgs e) { KeyEvents.OnKeyDown(s, e, game); }; mainWindow.KeyUp += delegate(object s, KeyEventArgs e) { KeyEvents.OnKeyUp(s, e, game); }; Timer.Start(); }