Example #1
0
        public ButtonViewModel(int row,int col,Game game)
        {
            this.game = game;
            pos = new Vector2D(row-1,col-1);

            Owner = game.Board[pos].Owner;

            IsValidMove = game.Board[pos].IsValidMove;

            Square = game.Board[pos];

            click=new ClickCommand(this);
        }
Example #2
0
 public GameViewModel()
 {
     game = Game.CreateNew();
     playerOneAI = Cell.Create(false);
     playerTwoAI = Cell.Create(false);
     playerOneAILevel = Cell.Create(0);
     playerTwoAILevel = Cell.Create(0);
     playerWithMostStones = game.PlayerWithMostStones;
     isGameOver = game.IsGameOver;
     currentPlayer = game.CurrentPlayer;
     createBoard();
     StartAI();
 }
Example #3
0
 public Square( Game game, Vector2D position )
 {
     this.game = game;
     this.position = position;
     this.owner = Cell.Derived( () => game.GetOwnerAt( position ) );
     this.isValidMove = Cell.Derived( () => game.IsValidMove( position ) );
 }
Example #4
0
 public ViewModel(Game game)
 {
     this.game = game;
     rows = Enumerable.Range(1, 8).Select(i => new RowViewModel(i,this.game)).ToList().AsReadOnly();
     ScorePlayer1=this.game.StoneCount(this.game.CurrentPlayer.Value);
     ScorePlayer2=this.game.StoneCount(this.game.CurrentPlayer.Value.Other);
     CurrentPlayer = this.game.CurrentPlayer;
     this.PlayerWithMostStones = this.game.PlayerWithMostStones;
     GameOver = this.game.IsGameOver;
 }
Example #5
0
 public RowViewModel(int row,Game game)
 {
     buttons = Enumerable.Range(1, 8).Select(i => new ButtonViewModel(row,i,game)).ToList().AsReadOnly();
 }