private void NewGame() { // TODO: Game init logic here var gameState = DemoData.GenerateGameState(); this.WindowManager.ShowMainWindow(gameState); this.CloseAction?.Invoke(); }
public MainWindowViewModel() { if (this.IsInDesignMode) { this.GameState = DemoData.GenerateGameState(); Messenger.Default.Send(new GameStateLoadedMessage(this.GameState)); var selectedPlanet = this.GameState.Galaxy.Planets.Find(p => p.X <= 200 && p.Y <= 200); Messenger.Default.Send(new PlanetSelectedMessage(selectedPlanet)); } }
public GalaxyMapPanelViewModel() { Messenger.Default.Register <GameStateLoadedMessage>(this, this.OnGameStateLoaded); this.MapClickCommand = new RelayCommand <MouseButtonEventArgs>(this.MapClick); if (this.IsInDesignMode) { if (this.Galaxy == null) { this.Galaxy = DemoData.GenerateGameState().Galaxy; } this.MapClick(new Point { X = 50, Y = 50 }); } }