Esempio n. 1
0
 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();
 }
Esempio n. 2
0
        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));
            });
        }
Esempio n. 3
0
        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);
            });
        }
Esempio n. 4
0
        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();
        }
Esempio n. 5
0
        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)));
        }
Esempio n. 6
0
 public ScreenGame(MainViewModel navigator) : base(navigator)
 {
     GoToWelcome = new EasyCommand(() => SwitchTo(new ScreenWelcome(navigator)));
 }
Esempio n. 7
0
 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)));
 }
Esempio n. 8
0
 public PuzzleEditorScreen(Navigator navigator) : base(navigator)
 {
     GoToMainMenu      = new EasyCommand(() => SwitchTo(new MenuScreen(navigator)));
     CreateEmptyPuzzle = new CreateEmptyPuzzleCommand();
 }
Esempio n. 9
0
 public MenuScreen(Navigator navigator) : base(navigator)
 {
     GoToSelection    = new EasyCommand(() => SwitchTo(navigator.selectionScreen));
     GoToPuzzleEditor = new EasyCommand(() => SwitchTo(new PuzzleEditorScreen(navigator)));
 }
Esempio n. 10
0
 public StartScreen(Navigator navigator) : base(navigator)
 {
     Start        = new EasyCommand(() => SwitchTo(new PlayableWindow(navigator)));
     ChoosePuzzle = new EasyCommand(() => SwitchTo(new PuzzleGenerator(navigator)));
 }