예제 #1
0
        public MainForm()
        {
            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;

            _computerIntelligence = new MinMaxAI();
            _music = new GameSounds();

            _game = new Game(_computerIntelligence);
            SubscribeEvents();
            _game.CreateNewGame();
        }
예제 #2
0
        public MainForm()
        {
            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;

            _computerIntelligence = new MinMaxAI();
            _music = new GameSounds();

            _game = new Game(_computerIntelligence);
            _game.InitDrawHandler      += InitializeDraw;
            _game.UpdateScoreHandler   += UpdateScoreAndPlayerMove;
            _game.ShomMessageHandler   += ShowMessage;
            _game.PlayGoodSoundHandler += _music.PlayGoodSound;
            _game.PlayBadSoundHandler  += _music.PlayBadSound;

            _game.CreateNewGame();
        }
예제 #3
0
 private void btn_newGameComputer_Click(object sender, EventArgs e)
 {
     pnl_Field.Enabled = true;
     _game.CreateNewGame();
     _game.EnableComputerMode(true);
 }