Esempio n. 1
0
        public void Execute(object parameter)
        {
            PuzzleEditScreen screen = (PuzzleEditScreen)parameter;

            screen.Editor.ResolveAmbiguity();
            var  facade = new PiCrossFacade();
            bool am     = false;

            foreach (IPuzzleEditorSquare square in screen.Editor.Grid.Items)
            {
                if (square.Ambiguity.Value == Ambiguity.Ambiguous)
                {
                    am = true;
                    break;
                }
            }
            if (!am)
            {
                IGameData           gameData = facade.LoadGameData("../../../../python/picross.zip", true);
                Puzzle              puzzle   = screen.Editor.BuildPuzzle();
                IPuzzleLibraryEntry entry    = gameData.PuzzleLibrary.Create(puzzle, "Jonas");
                screen.navigator.selectionScreen.cell.Value.Add(new PuzzleViewModel(entry));
                screen.navigator.selectionScreen.PuzzleSizes.Add(puzzle.Size);
                screen.SwitchTo(new MenuScreen(screen.navigator));
            }
        }
        public IPlayerPuzzleInformation this[IPuzzleLibraryEntry libraryEntry]
        {
            get
            {
                var entry = ((PuzzleLibraryEntryAdapter)libraryEntry);

                return(new PlayerPuzzleInformationEntryAdapter(data[entry.UID]));
            }
        }
 public PuzzleEntryViewModel(IPuzzleLibraryEntry puzzle, SelectPuzzleViewModel parent)
 {
     Parent   = parent;
     Puzzle   = puzzle;
     Grid     = Puzzle.Puzzle.Grid;
     Author   = "Author: " + puzzle.Author;
     Select   = new PuzzleLeft(this);
     Selected = Cell.Create <bool>(false);
 }
Esempio n. 4
0
 public void StartGame(IPuzzleLibraryEntry puzzle)
 {
     ActivePuzzle        = puzzle.Puzzle;
     this.PlayablePuzzle = new PiCrossFacade().CreatePlayablePuzzle(puzzle.Puzzle);
     this.SquareGrid     = Grid.Create <SquareViewModel>(PlayablePuzzle.Grid.Size, p => new SquareViewModel(PlayablePuzzle.Grid[p]));
 }
Esempio n. 5
0
 public PuzzleViewModel(IPuzzleLibraryEntry entry)
 {
     this.Vm    = new PicrossViewModel(entry.Puzzle);
     this.Entry = entry;
 }