Exemplo n.º 1
0
        public doublepeople()
        {
            InitializeComponent();
            int r = 19, c = 10;
            //myGame = new MyGameFrame(myGrid, r, c);
            myGame = new MyGameFrame(myGrid, r, c);

            //myGame.AIInitialize(new SimpleAI(r, c, myGame,new Complex_AI_Integrator()));

            FriendGame = new MyGameFrame(aiGrid, r, c);
            //FriendGame.AIInitialize(new SimpleAI(r, c, FriendGame, new Simple_AI_Integrator()));
            preview = new PreviewWindow(myGame, PreviewImage);
            preview = new PreviewWindow(FriendGame, PreviewImage1);
            //设置计分板
            plarSc = new DoubleScoringBoard(PlayerScoreLabel);
            myGame.RowsCleanEvent += plarSc.GetScore;
            myGame.RowsCleanEvent += Play;
            aiSc = new DoubleScoringBoard(AIScoreLabel);
            FriendGame.RowsCleanEvent += aiSc.GetScore;

            plarSc.Threshold = aiSc.Threshold = 800;

            //增加增行函数的事件绑定
            aiSc.CrossThreshold += myGame.OtherCrossThreshold;
            plarSc.CrossThreshold += FriendGame.OtherCrossThreshold;

            //设置游戏结束
            myGame.GameOverEvent += GameFinish;
            myGame.GameOverEvent += plarSc.WhenGameOver;
            FriendGame.GameOverEvent += GameFinish;
            FriendGame.GameOverEvent += aiSc.WhenGameOver;

        }
Exemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();

            game = new MyGameFrame(gameGrid,19,11);

            scoreBoard = new ScoringBoard(Scoring_Board);

            preview = new PreviewWindow(game, PreviewImage);

            game.RowsCleanEvent += scoreBoard.GetScore;
            game.GameOverEvent += scoreBoard.WhenGameOver;
        }
		public Singleplaywindow()
		{
			InitializeComponent();
            // 在此点之下插入创建对象所需的代码。
           
            game = new MyGameFrame(gameGrid,19,11);

            scoreBoard = new ScoringBoard(Scoring_Board);

            preview = new PreviewWindow(game, PreviewImage);

            game.RowsCleanEvent += scoreBoard.GetScore;
            game.RowsCleanEvent += Play;           

            game.GameOverEvent += scoreBoard.WhenGameOver;
            //game.GameOverEvent += writeScoreRating;
        }
Exemplo n.º 4
0
        public DoublePlayer()
        {
            InitializeComponent();

            int r=19,c=10;
            //myGame = new MyGameFrame(myGrid, r, c);
            myGame = new MyGameFrame(myGrid, r, c);
            
            //myGame.AIInitialize(new SimpleAI(r, c, myGame,new Complex_AI_Integrator()));

            myAIFrame = new AIFrame(aiGrid, r, c);
            myAIFrame.AIInitialize(new SimpleAI(r,c,myAIFrame,new Simple_AI_Integrator()));

            //设置计分板
            plarSc = new DoubleScoringBoard(PlayerScoreLabel);
            myGame.RowsCleanEvent += plarSc.GetScore;
            myGame.RowsCleanEvent += Play;
            aiSc = new DoubleScoringBoard(AIScoreLabel);
            myAIFrame.RowsCleanEvent += aiSc.GetScore;

            plarSc.Threshold = aiSc.Threshold = 800;

            //增加增行函数的事件绑定
            aiSc.CrossThreshold += myGame.OtherCrossThreshold;
            plarSc.CrossThreshold += myAIFrame.OtherCrossThreshold;

            //设置游戏结束
            myGame.GameOverEvent += GameFinish;
            myGame.GameOverEvent += plarSc.WhenGameOver;
            myAIFrame.GameOverEvent += GameFinish;
            myAIFrame.GameOverEvent += aiSc.WhenGameOver;
            //img preview
          PreviewWindow  preview = new PreviewWindow(myGame, playerImg);
          PreviewWindow  preview1 = new PreviewWindow(myAIFrame, aiImg);

        }