Esempio n. 1
0
        public void StartGame(IAi aiModule)
        {
            _ai = aiModule;
            //use the aiModule to calculate the computer movements.
            _model = new Logic();

            // nézemodell létrehozása
            _viewModel            = new TicTacToeViewModel(_model);
            _viewModel.GameEnded += GameEnded;
            _viewModel.CpuStep   += CpuStep;

            // nézet létrehozása
            _view             = new MainWindow();
            _view.DataContext = _viewModel;
            _view.Show();

            Testing     test     = new Testing();
            UnitTesting unitTest = new UnitTesting();
        }
Esempio n. 2
0
 public TicTacToeView()
 {
     DataContext = new TicTacToeViewModel(this);
     InitializeComponent();
 }
Esempio n. 3
0
 public TicTacToeControl(TicTacToeViewModel vm)
 {
     InitializeComponent();
     DataContext   = _vm = vm;
     _vm.GameOver += OnGameFinished;
 }