protected void ResetGame() { m_gameTable.resetTable( ); m_gameTable.calculateWhitePiecesPosition( false ); m_playTurn = Play_Turn.White_Turn; }
protected void changeTurn() { if (m_playTurn == Play_Turn.Black_Turn) m_playTurn = Play_Turn.White_Turn; else m_playTurn = Play_Turn.Black_Turn; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here base.Initialize(); m_rectTable.X = 0; m_rectTable.Y = 0; m_rectTable.Width = 640; m_rectTable.Height = 640; m_graphics.PreferredBackBufferHeight = 640; m_graphics.PreferredBackBufferWidth = 640; m_graphics.ApplyChanges(); m_listTargetsMovements = new List<Point>(); m_gameTable = new Table(); m_bPieceSelected = false; m_bResetGame = true; m_bInitGame = false; m_bCanBePressed = false; m_updateCounts = 0; m_stateSplash = SPLASH_STATES.OPEN; m_playTurn = Play_Turn.White_Turn; m_bPlayerBlackCPU = true; m_bPlayerWhiteCPU = false; m_cpuPlayer = new MiniMax(); m_cpuPlayer.setTeam(m_bPlayerBlackCPU); // CPU is with Black pieces. m_DeadBlackSpaces = new Rectangle[TOTAL_BLACK_PIECES]; m_DeadWhiteSpaces = new Rectangle[TOTAL_WHITE_PIECES]; InitializeDeadSpaces(); m_gameTable.calculateWhitePiecesPosition( false ); m_rectPlayNow.Height = 100; m_rectPlayNow.Width = 20; m_rectPlayNow.X = (36 / 2) - (m_rectPlayNow.Width/2); m_rectPlayNow.Y = (640 / 2) - (m_rectPlayNow.Height/2); m_rectButton.Height = 20; m_rectButton.Width = m_rectPlayNow.Width; m_rectButton.X = (36 / 2) - (m_rectButton.Width / 2); m_rectButton.Y = ((m_rectPlayNow.Y + m_rectPlayNow.Height) + 4); m_rectSplashScreens.Height = 300; m_rectSplashScreens.Width = 400; m_rectSplashScreens.X = (m_rectTable.Width / 2) - (m_rectSplashScreens.Width / 2); m_rectSplashScreens.Y = (m_rectTable.Height / 2) - (m_rectSplashScreens.Height / 2); }