public void Start(MainWindowViewModel mainWindowViewModel, IPlayablePuzzle puzzle) { this.Vm = mainWindowViewModel; this.StartTimer(); this.PlayablePuzzle = puzzle; this.Grid = this.PlayablePuzzle.Grid.Map(puzzleSquare => new PlayablePuzzleSquareViewModel(puzzleSquare)).Copy(); }
public PlayablePuzzleViewModel(MainWindowViewModel Mainvm, IPlayablePuzzle puzzle, String title) { this.VM = Mainvm; this.puzzle = puzzle; this.Title = title; this.SelectPuzzle = new Select(this.VM, this.puzzle); }
public PuzzleVM(StartupVM startup, IPlayablePuzzle IplayablePuzzle) { this.wrapped = IplayablePuzzle; this.StartupVM = startup; this.PiCrossFacade = new PiCrossFacade(); this.Grid = this.wrapped.Grid.Map(puzzleSquare => new SquareVM(puzzleSquare)).Copy(); }
public void Start(MainViewModel viewModel, IPlayablePuzzle puzzle) { this.Vm = viewModel; this.PlayablePuzzle = puzzle; this.Grid = this.PlayablePuzzle.Grid.Map(puzzlesquare => new PuzzleSquareViewModel(puzzlesquare)).Copy(); this.Chronometer = new Chronometer(); timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromMilliseconds(250); timer.Tick += (o, s) => { if (IsSolved.Value) { timer.Stop(); Chronometer.Pause(); } else { Chronometer.Tick(); } }; timer.Start(); this.Chronometer.Start(); }
public PuzzleViewModel(Puzzle puzzle, MainViewModel mainViewModel) { this.Puzzle = puzzle; this.MainViewModel = mainViewModel; this.PlayablePuzzle = this.MainViewModel.PiCrossFacade.CreatePlayablePuzzle(this.Puzzle); this.Select = new Command(() => this.MainViewModel.StartGame(this.PlayablePuzzle)); }
public void Start() { var facade = new PiCrossFacade(); PlayablePuzzle = facade.CreatePlayablePuzzle(Puzzle); PlayablePuzzle.IsSolved.ValueChanged += IsSolvedValueChanged; grid.Value = PlayablePuzzle.Grid.Map(square => new SquareVM(square)).Copy(); }
public GameViewModel(MainWindowViewModel mainWindowViewModel, IPlayablePuzzle playablePuzzle) { this.MainWindowViewModel = mainWindowViewModel; this.Start(mainWindowViewModel, playablePuzzle); this.StartTimer(); this.BackCommand = new EasyCommand(() => this.MainWindowViewModel.StartView()); this.QuitCommand = new EasyCommand(() => this.MainWindowViewModel.CloseWindow()); }
public PlayablePuzzleVM(IPlayablePuzzle puzzle) { this.puzzle = puzzle; this.RowConstraints = Sequence.FromEnumerable(puzzle.RowConstraints.Select(constraint => new ConstraintsVM(constraint))); this.ColumnConstraints = Sequence.FromEnumerable(puzzle.ColumnConstraints.Select(constraint => new ConstraintsVM(constraint))); this.Grid = puzzle.Grid.Map(square => new SquareVM(square)).Copy(); this.IsSolved = puzzle.IsSolved; }
public PlayWindowViewModel(IPlayablePuzzle puzzle) { this.DemoPlayablePluzzle = puzzle; this.Grid = DemoPlayablePluzzle.Grid.Map(square => new PuzzleSquareViewModel(square)).Copy(); this.ColumnConstraints = DemoPlayablePluzzle.ColumnConstraints.Map(constraint => new PuzzleConstraintsViewModel(constraint)).Copy(); this.RowConstraints = DemoPlayablePluzzle.RowConstraints.Map(constraint => new PuzzleConstraintsViewModel(constraint)).Copy(); this.Retry = new RetryCommand(this.VM); this.Exit = new ExitCommand(this.VM); }
public GameVM(Puzzle puzzle) { var facade = new PiCrossFacade(); this.playablePuzzle = facade.CreatePlayablePuzzle(puzzle); this.Grid = this.playablePuzzle.Grid.Map(square => new SquareVM(square)); this.RowConstraints = this.playablePuzzle.RowConstraints.Map(row => new RowConstraintsVM(row)); this.ColumnConstraints = this.playablePuzzle.ColumnConstraints.Map(column => new ColumnConstraintsVM(column)); this.Completed = this.playablePuzzle.IsSolved; }
public PuzzleVM(StartupVM startup, Puzzle playablePuzzle) { var puzzle = playablePuzzle; this.StartupVM = startup; this.PiCrossFacade = new PiCrossFacade(); this.wrapped = PiCrossFacade.CreatePlayablePuzzle(puzzle); this.Grid = this.wrapped.Grid.Map(puzzleSquare => new SquareVM(puzzleSquare)).Copy(); }
public GameViewModel(Puzzle puzzle) { var facade = new PiCrossFacade(); this.playablePuzzle = facade.CreatePlayablePuzzle(puzzle); this.Grid = this.playablePuzzle.Grid.Map(square => new SquareViewModel(square)).Copy(); this.RowConstraints = this.playablePuzzle.RowConstraints.Map(row => new RowViewModel(row)).Copy(); this.ColumnConstraints = this.playablePuzzle.ColumnConstraints.Map(column => new ColumnViewModel(column)).Copy(); IsSolved = playablePuzzle.IsSolved; }
public HelpCommand(IPlayablePuzzle puzzle) { this.puzzle = puzzle; var facade = new PiCrossFacade(); solvedPuzzle = facade.CreateStepwisePuzzleSolver(PlayablePuzzleConstraintsToConstraints(puzzle.RowConstraints), PlayablePuzzleConstraintsToConstraints(puzzle.ColumnConstraints)); while (!solvedPuzzle.IsSolved) { solvedPuzzle.Step(); } }
public PuzzleViewModel(Puzzle puzzle) { var facade = new PiCrossFacade(); this.playablePuzzle = facade.CreatePlayablePuzzle(puzzle); this.Grid = playablePuzzle.Grid.Map((IPlayablePuzzleSquare s) => new SquareViewModel(s)); this.ColumnConstraints = playablePuzzle.ColumnConstraints.Map((IPlayablePuzzleConstraints c) => new ConstraintsViewModel(c)); this.RowConstraints = playablePuzzle.RowConstraints.Map((IPlayablePuzzleConstraints c) => new ConstraintsViewModel(c)); this.ElapsedTime = Cell.Create(TimeSpan.Zero); InitiateTimer(); }
private void initialize(MainViewModel mainViewModel, IPlayablePuzzle playablePuzzle) { this.MainViewModel = mainViewModel; this.PlayablePuzzle = playablePuzzle; // => is een lambda expressie, di een blok code die behandeld wordt als een object // normaal --> een anonieme inner klasse maken //public void actionPerformed(ActionEvent square){ // square = new... //} //copy creeert de grid this.Grid = PlayablePuzzle.Grid.Map(square => new SquareViewModel(square)).Copy(); this.Quit = new Command(() => this.MainViewModel.Close()); this.Back = new Command(() => this.MainViewModel.BackToStart()); }
public PicrossViewModel(Puzzle puzzle) { IsSolved = Cell.Create <bool>(false); var facade = new PiCrossFacade(); playablePuzzle = facade.CreatePlayablePuzzle(puzzle); this.Grid = this.playablePuzzle.Grid.Map(square => new SquareViewModel(square)); this.Chronometer = new Chronometer(); timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromMilliseconds(250); timer.Tick += (o, s) => Chronometer.Tick(); timer.Start(); RowConstraints = new PlayablePuzzleConstraintsViewModel(this.playablePuzzle.RowConstraints); ColumnConstraints = new PlayablePuzzleConstraintsViewModel(this.playablePuzzle.ColumnConstraints); }
public GameViewModel() { var puzzle = Puzzle.FromRowStrings( "xxxxx", "x...x", "x...x", "x...x", "xxxxx" ); var facade = new PiCrossFacade(); this.PlayablePuzzle = facade.CreatePlayablePuzzle(puzzle); Console.WriteLine(PlayablePuzzle.RowConstraints.Items); //var vmGrid = this.PlayablePuzzle.Grid.Map(square => new SquareViewModel(square)).Copy(); }
public PuzzleVM(StartupVM startup) { var puzzle = Puzzle.FromRowStrings( "xxxxx", "x...x", "x...x", "x...x", "xxxxx" ); this.StartupVM = startup; this.PiCrossFacade = new PiCrossFacade(); this.wrapped = PiCrossFacade.CreatePlayablePuzzle(puzzle); this.Grid = this.wrapped.Grid.Map(puzzleSquare => new SquareVM(puzzleSquare)).Copy(); }
public GameViewModel(Puzzle puzzle) { var facade = new PiCrossFacade(); this.playablePuzzle = facade.CreatePlayablePuzzle(puzzle); this.Grid = this.playablePuzzle.Grid.Map(square => new SquareVM(square)).Copy(); this.ColumnConstraints = this.playablePuzzle.ColumnConstraints.Map(column => new ColumnsVM(column)).Copy(); this.RowConstraints = this.playablePuzzle.RowConstraints.Map(row => new RowsVM(row)).Copy(); Check = playablePuzzle.IsSolved; this.StartTimer = new StartTimer(this); this.StopTimer = new StopTimer(this); lastTick = DateTime.Now; timerken = new DispatcherTimer(TimeSpan.FromMilliseconds(10), DispatcherPriority.Background, t_Tick, Dispatcher.CurrentDispatcher); timerken.IsEnabled = true; }
public PlayWindowViewModel(MainWindowViewModel Mainvm) { this.VM = Mainvm; var DemoPuzzle = Puzzle.FromRowStrings( ".xxx.", "x.x.x", "xxxxx", "x.x.x", ".xxx." ); var Facade = new PiCrossFacade(); this.DemoPlayablePluzzle = Facade.CreatePlayablePuzzle(DemoPuzzle); this.Grid = DemoPlayablePluzzle.Grid.Map(square => new PuzzleSquareViewModel(square)).Copy(); this.ColumnConstraints = DemoPlayablePluzzle.ColumnConstraints.Map(constraint => new PuzzleConstraintsViewModel(constraint)).Copy(); this.RowConstraints = DemoPlayablePluzzle.RowConstraints.Map(constraint => new PuzzleConstraintsViewModel(constraint)).Copy(); this.Retry = new RetryCommand(this.VM); this.Exit = new ExitCommand(this.VM); }
public void startGame(IPlayablePuzzle puzzle) { this.ActiveWindow = new PlayWindowViewModel(puzzle); }
public PuzzleVM(IPlayablePuzzle playablePuzzle) { this.playablePuzzle = playablePuzzle; }
internal void Newgame(IPlayablePuzzle puzzle) { this.CurrentWindow = new PuzzleVM(this, puzzle); }
public Select(MainWindowViewModel Mainvm, IPlayablePuzzle puzzle) { this.VM = Mainvm; this.puzzle = puzzle; }
public void StartGame(IPlayablePuzzle puzzle) { this.ActiveScreen = new GameViewModel(this, puzzle); }
public GameScreenViewModel(MainScreenViewModel mainScreenViewModel, IPlayablePuzzle playablePuzzle) { this.Start(mainScreenViewModel, playablePuzzle); }
public CheckSolutionCommand(IPlayablePuzzle puzzle) { this.puzzle = puzzle; }
public void Start(MainScreenViewModel mainScreenViewModel, IPlayablePuzzle puzzle) { this.Msvm = mainScreenViewModel; this.PlayablePuzzle = puzzle; this.Grid = this.PlayablePuzzle.Grid.Map(square => new SquareViewModel(square)).Copy(); }
public IEnumerator PlayPuzzle(IPlayablePuzzle puzzle) { throw new System.NotImplementedException(); }
public GameViewModel(MainViewModel mainViewModel, IPlayablePuzzle puzzle) { this.initialize(mainViewModel, puzzle); }