Ejemplo n.º 1
0
        public void InitialState4x4()
        {
            var board = ReversiBoard.CreateInitialState(4, 4);

            Assert.AreSame(Player.WHITE, board[new Vector2D(1, 1)]);
            Assert.AreSame(Player.WHITE, board[new Vector2D(2, 2)]);
            Assert.AreSame(Player.BLACK, board[new Vector2D(1, 2)]);
            Assert.AreSame(Player.BLACK, board[new Vector2D(2, 1)]);

            Assert.IsNull(board[new Vector2D(0, 0)]);
            Assert.IsNull(board[new Vector2D(1, 0)]);
            Assert.IsNull(board[new Vector2D(2, 0)]);
            Assert.IsNull(board[new Vector2D(3, 0)]);

            Assert.IsNull(board[new Vector2D(0, 3)]);
            Assert.IsNull(board[new Vector2D(1, 3)]);
            Assert.IsNull(board[new Vector2D(2, 3)]);
            Assert.IsNull(board[new Vector2D(3, 3)]);

            Assert.IsNull(board[new Vector2D(0, 1)]);
            Assert.IsNull(board[new Vector2D(0, 2)]);

            Assert.IsNull(board[new Vector2D(3, 1)]);
            Assert.IsNull(board[new Vector2D(3, 2)]);
        }
Ejemplo n.º 2
0
        public void InitialState2x2()
        {
            var board = ReversiBoard.CreateInitialState(2, 2);

            Assert.AreSame(Player.WHITE, board[new Vector2D(0, 0)]);
            Assert.AreSame(Player.WHITE, board[new Vector2D(1, 1)]);
            Assert.AreSame(Player.BLACK, board[new Vector2D(0, 1)]);
            Assert.AreSame(Player.BLACK, board[new Vector2D(1, 0)]);
        }
        public OptionsViewModel()
        {
            var bordview = new BoardViewModel(ReversiBoard.CreateInitialState(6, 6), this); // hetzelfde spel wordt hier gebruikt, we gaan dezelfde bordview gebruiken om onze gegevens uit te halen

            this.OptionPanes = new List <object> {
                new OptionsCategory(new StartWindow(this)),
                new OptionsCategory(bordview),//Maakt bord aan
            };
            this.SelectedOptionPane = OptionPanes.First();
        }
Ejemplo n.º 4
0
        public void Execute(object parameter) // wat er gebeurt wanneer men op de knop zelf klikt
        {
            BoardViewModel bvm;

            bvm               = new BoardViewModel(ReversiBoard.CreateInitialState(6, 6), viewModel);// waardes grote ingeven
            bvm.height        = startWindow.height;
            bvm.width         = startWindow.width;
            bvm               = new BoardViewModel(ReversiBoard.CreateInitialState(bvm.width, bvm.height), viewModel);
            bvm.playerNameOne = startWindow.playerNameOne;
            bvm.playerNameTwo = startWindow.playerNameTwo;

            viewModel.SelectedOptionPane = new OptionsViewModel.OptionsCategory(bvm);
            System.Diagnostics.Debug.WriteLine(bvm.playerNameOne + " playerOne");
        }
        public void Execute(object parameter)
        {
            BoardViewModel b;

            try
            {
                b = new BoardViewModel(ReversiBoard.CreateInitialState(StartScreen.Width, StartScreen.Height), Options);
            }
            catch (Exception)
            {
                b = new BoardViewModel(ReversiBoard.CreateInitialState(6, 6), Options);
            }
            Debug.WriteLine("Heigt= " + b.Board.Height);
            Debug.WriteLine("Width= " + b.Board.Width);
            Options.SelectedOptionPane = new OptionsViewModel.OptionsCategory(b);
        }
Ejemplo n.º 6
0
        public void Execute(object parameter)
        {
            BoardViewModel bvm;

            try
            {
                bvm           = new BoardViewModel(ReversiBoard.CreateInitialState(startWindow.Width, startWindow.Height), optionsView);
                bvm.playerOne = startWindow.playerOne;
                bvm.playerTwo = startWindow.playerTwo;
            }
            catch (Exception)
            {
                bvm           = new BoardViewModel(ReversiBoard.CreateInitialState(6, 6), optionsView);
                bvm.playerOne = startWindow.playerOne;
                bvm.playerTwo = startWindow.playerTwo;
            }
            this.optionsView.SelectedOptionPane = new OptionsViewModel.OptionsCategory(bvm);
        }
Ejemplo n.º 7
0
 public ScreenA(Navigator navigator) : base(navigator)
 {
     this.BoardViewModel = new BoardViewModel(ReversiBoard.CreateInitialState(4, 4));
 }