File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,9 @@ void WsClient::parseServerList(const cpr::Response &response)
170170 {
171171 this ->deathNote = ex.what ();
172172 this ->isDead = true ;
173+ #ifndef NDEBUG
174+ spdlog::error (ex.what ());
175+ #endif // DEBUG
173176 }
174177}
175178
Original file line number Diff line number Diff line change @@ -36,12 +36,12 @@ inline LocalGameManager::LocalGameManager(sf::RenderWindow *windowPtr)
3636}
3737
3838/* *
39- * Create all pieces for both players and add them to pieceList, using std C++ random num generator
39+ * Create all pieces for both players ( using std C++ PRNG), then place them on the board.
4040 */
4141inline void LocalGameManager::createAllPieces ()
4242{
4343 std::random_device randomDevice;
44- std::mt19937 randEngine ( randomDevice ()) ;
44+ std::mt19937 randEngine{ randomDevice ()} ;
4545 std::uniform_int_distribution<short > dist (1 , std::numeric_limits<short >::max ());
4646
4747 // Reserve container for pieces on board
Original file line number Diff line number Diff line change @@ -87,9 +87,9 @@ inline void chk::OnlineGameManager::createAllPieces()
8787 std::vector<chk::PiecePtr> pieceList;
8888 pieceList.reserve (chk::NUM_PIECES);
8989
90- auto redItr = payload.pieces_red ().begin ();
91- auto blackItr = payload.pieces_black ().begin ();
92- // create pieces objects, and position them on Board
90+ auto redItr = payload.pieces_red ().begin (); // red iterator
91+ auto blackItr = payload.pieces_black ().begin (); // black iterator
92+ // place them on board
9393 for (uint16_t row = 0 ; row < chk::NUM_ROWS; row++)
9494 {
9595 for (uint16_t col = 0 ; col < chk::NUM_COLS; col++)
@@ -132,7 +132,7 @@ inline void chk::OnlineGameManager::createAllPieces()
132132 this ->playerBlack ->receivePiece (pp);
133133 }
134134 }
135- pieceList.clear (); // SAFE! no longer used .
135+ pieceList.clear (); // SAFE! no longer needed .
136136 this ->startMoveListener ();
137137 this ->startCaptureListener ();
138138 });
You can’t perform that action at this time.
0 commit comments