@@ -9,7 +9,7 @@ CGobangChessboard::CGobangChessboard(QWidget *parent)
99 : QLabel(parent)
1010{
1111 /* * [InitializeVirtualChessboard] */
12- m_virtualChessboard = (CGobangChessman **)new CGobangChessman*[15 ];
12+ m_virtualChessboard = (CGobangChessman**) new CGobangChessman*[15 ];
1313 for (int i = 0 ; i < 15 ; ++i)
1414 {
1515 m_virtualChessboard[i] = new CGobangChessman[15 ];
@@ -61,7 +61,7 @@ CGobangChessboard::CGobangChessboard(QWidget *parent)
6161
6262void CGobangChessboard::restart ()
6363{
64- // qDebug() << "=====重新开始=====";
64+ qDebug () << " =====重新开始=====" ;
6565
6666
6767 /* * [InitializeVirtualChessboard] */
@@ -151,7 +151,7 @@ void CGobangChessboard::ai()
151151
152152
153153 /* * [Play] */
154- // qDebug() << "White:" << m_virtualChessboard[highestScoreIndexX][highestScoreIndexY].score();
154+ qDebug () << " White:" << m_virtualChessboard[highestScoreIndexX][highestScoreIndexY].score ();
155155 this ->paintChessman (highestScoreIndexX, highestScoreIndexY, CGobangChessman::CChessmanType::Type_White);
156156 m_virtualChessboard[highestScoreIndexX][highestScoreIndexY].setChessman (CGobangChessman::CChessmanType::Type_White);
157157 m_playerChessmanType = CGobangChessman::CChessmanType::Type_Black;
@@ -1166,7 +1166,7 @@ void CGobangChessboard::mouseReleaseEvent(QMouseEvent *mouseReleaseEvent)
11661166 }
11671167 if (m_virtualChessboard[newChessboardPositionIndexX][newChessboardPositionIndexY].isEmpty ())
11681168 {
1169- // qDebug() << "Black:" << m_virtualChessboard[newChessboardPositionIndexX][newChessboardPositionIndexY].score();
1169+ qDebug () << " Black:" << m_virtualChessboard[newChessboardPositionIndexX][newChessboardPositionIndexY].score ();
11701170 this ->paintChessman (newChessboardPositionIndexX, newChessboardPositionIndexY, CGobangChessman::CChessmanType::Type_Black);
11711171 m_virtualChessboard[newChessboardPositionIndexX][newChessboardPositionIndexY].setChessman (CGobangChessman::CChessmanType::Type_Black);
11721172 m_playerChessmanType = CGobangChessman::CChessmanType::Type_White;
@@ -1176,10 +1176,9 @@ void CGobangChessboard::mouseReleaseEvent(QMouseEvent *mouseReleaseEvent)
11761176
11771177void CGobangChessboard::paintChessboard ()
11781178{
1179+ /* * [SetPainter] */
11791180 QImage *temporaryImage = new QImage (m_chessboardImagePixelLength, m_chessboardImagePixelLength, QImage::Format_ARGB32);
11801181 QPainter painter;
1181-
1182- /* * [SetPainter] */
11831182 painter.begin (temporaryImage);
11841183 painter.setPen (QPen (COLOR_BLACK));
11851184 painter.setBrush (QBrush (COLOR_BLACK));
@@ -1246,15 +1245,11 @@ void CGobangChessboard::paintChessboard()
12461245 /* [PaintEllipses] **/
12471246
12481247
1249- /* * [LoadPaintedImage ] */
1248+ /* * [LoadAndSavePaintedImage ] */
12501249 painter.end ();
12511250 this ->setPixmap (QPixmap::fromImage (*temporaryImage));
1252- /* [LoadPaintedImage] **/
1253-
1254-
1255- /* * [SavePaintedImage] */
12561251 m_vectorPlayImagesHistory.append (temporaryImage);
1257- /* [SavePaintedImage ] **/
1252+ /* [LoadPaintedImage ] **/
12581253}
12591254
12601255void CGobangChessboard::paintPredictor ()
@@ -1290,11 +1285,9 @@ void CGobangChessboard::paintPredictor()
12901285
12911286bool CGobangChessboard::paintChessman (int indexX, int indexY, CGobangChessman::CChessmanType chessmanType)
12921287{
1288+ /* * [SetPainter] */
12931289 QImage *temporaryImage = new QImage (*m_vectorPlayImagesHistory.last ());
12941290 QPainter painter;
1295-
1296-
1297- /* * [SetPainter] */
12981291 painter.begin (temporaryImage);
12991292 switch (chessmanType)
13001293 {
0 commit comments