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 string Color { get; set; } public PlayerViewModel(GameViewModel Game, Player player, PlayerOptionsViewModel options) { this.Game = Game; this.Player = player; this.options = options; this.Score = Cell.Cell.Create(Game.Board.CountStones(Player)); Game.PropertyChanged += (s, e) => { this.Score.Value = Game.Board.CountStones(Player); }; }
public GameViewModel(MainViewModel viewModel, int width, int height, PlayerOptionsViewModel options) : base(viewModel) { this.Game = new ReversiGame(width, height); this.BoardVM = new BoardViewModel(this, options); this.Board = Game.Board; this.CurrentPlayer = Game.CurrentPlayer; this.Options = options; this.PlayerB = new PlayerViewModel(this, Player.BLACK, options); this.PlayerW = new PlayerViewModel(this, Player.WHITE, 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 BoardSquareViewModel(GameViewModel game, Vector2D position, PlayerOptionsViewModel options) { this.Game = game; this.Position = position; this.PutStone = new PutStoneCommand(Game, Position); this.Options = options; if (Game.Board[Position] != null) { this.Owner = Cell.Cell.Create(Game.Board[Position]); } else { this.Owner = Cell.Cell.Create((Player)null); } this.Valid = Cell.Cell.Create(Game.IsValidMove(Position)); Game.PropertyChanged += (s, e) => { Refresh(); }; }
public BoardRowViewModel(GameViewModel game, int rowNumber, PlayerOptionsViewModel options) { this.Game = game; this.rowNumber = rowNumber; this.Options = options; }
public BoardViewModel(GameViewModel game, PlayerOptionsViewModel options) { this.Game = game; this.Options = options; }