public PuzzleEditScreen(Navigator navigator, IPuzzleEditor editor) : base(navigator) { this.Editor = editor; Grid = Editor.Grid.Map(square => new PuzzleEditorSquareViewModel(square)); GoBack = new EasyCommand(() => SwitchTo(new PuzzleEditorScreen(navigator))); SavePuzzle = new SavePuzzleCommand(); }
public WelcomeViewModel(MainViewModel viewModel) : base(viewModel) { this.Width = 8; this.Height = 8; this.Options = new PlayerOptionsViewModel(); StartGame = new EasyCommand(() => { SwitchTo(new GameViewModel(this.viewModel, Width, Height, Options)); }); }
public GameOverViewModel(MainViewModel model, PlayerOptionsViewModel options, PlayerViewModel winner) : base(model) { this.Options = options; this.Winner = winner; Exit = new ExitCommand(this.viewModel); Restart = new EasyCommand(() => { WelcomeViewModel newGame = new WelcomeViewModel(this.viewModel); newGame.Options = Options; SwitchTo(newGame); }); }
public SelectionScreen(Navigator navigator) : base(navigator) { var facade = new PiCrossFacade(); cell = Cell.Create <IList <PuzzleViewModel> >(facade.LoadGameData("../../../../python/picross.zip").PuzzleLibrary.Entries.Select(entry => new PuzzleViewModel(entry)).ToList()); backup = this.Puzzles.Select(puzzle => puzzle).ToList(); PuzzleSizes = this.Puzzles.Select(puzzle => puzzle.Entry.Puzzle.Size).Distinct().ToList(); GoToPuzzle = new GoToPuzzleCommand(navigator, this); GoToMenu = new EasyCommand(() => SwitchTo(new MenuScreen(navigator))); FilterUnsolved = new FilterUnsolvedCommand(); FilterSize = new FilterSizeCommand(); ClearFilters = new ClearFiltersCommand(); OrderBySolved = new OrderBySolvedCommand(); OrderByUnsolved = new OrderByUnsolvedCommand(); OrderBySize = new OrderBySizeCommand(); }
public PlayableWindow(Navigator navigator, Puzzle puzzle = null) : base(navigator) { if (puzzle == null) { puzzle = Puzzle.FromRowStrings( "xxx", "x..", "x.x" ); } var facade = new PiCrossFacade(); playablePuzzle = facade.CreatePlayablePuzzle(puzzle); this.Grid = playablePuzzle.Grid.Map(square => new ChangeableSquare(square)).Copy(); this.ColumnConstraints = playablePuzzle.ColumnConstraints /*.Map(constraints => new ChangeableCC(constraints)).Copy()*/; this.RowConstraints = playablePuzzle.RowConstraints /*.Map(constraints => new ChangeableCC(constraints)).Copy()*/; BackToStart = new EasyCommand(() => SwitchTo(new StartScreen(navigator))); Refresh = new EasyCommand(() => SwitchTo(new PlayableWindow(navigator, puzzle))); ChooseOther = new EasyCommand(() => SwitchTo(new PuzzleGenerator(navigator))); }
public ScreenGame(MainViewModel navigator) : base(navigator) { GoToWelcome = new EasyCommand(() => SwitchTo(new ScreenWelcome(navigator))); }
public PlayablePuzzles(Navigator navigator, Puzzle puzzle, String title) : base(navigator) { this.Size = puzzle.Size.ToString(); this.Title = title; SelectPuzzle = new EasyCommand(() => SwitchTo(new PlayableWindow(navigator, puzzle))); }
public PuzzleEditorScreen(Navigator navigator) : base(navigator) { GoToMainMenu = new EasyCommand(() => SwitchTo(new MenuScreen(navigator))); CreateEmptyPuzzle = new CreateEmptyPuzzleCommand(); }
public MenuScreen(Navigator navigator) : base(navigator) { GoToSelection = new EasyCommand(() => SwitchTo(navigator.selectionScreen)); GoToPuzzleEditor = new EasyCommand(() => SwitchTo(new PuzzleEditorScreen(navigator))); }
public StartScreen(Navigator navigator) : base(navigator) { Start = new EasyCommand(() => SwitchTo(new PlayableWindow(navigator))); ChoosePuzzle = new EasyCommand(() => SwitchTo(new PuzzleGenerator(navigator))); }