fix: callback funtion not injected when restarting the game

This commit is contained in:
2026-01-16 18:05:53 +08:00
parent 94502e6104
commit 52badbfd1c

View File

@@ -140,4 +140,12 @@ void GameScene::restartGame() {
m_gameUIManager->updateActionType(ActionType::GROW);
m_gameUIManager->updateGameState(GameState::GAME_RUNING);
m_boardRenderer->setGameState(GameState::GAME_RUNING);
m_gameSession->setGamePieceEventCallback(
[this](GamePieceEvent evnet, int row, int col) {
std::cout << "GameScene: recevie the event piece at " << row << " " << col << "\n";
m_boardRenderer->handleGamePieceEvent(evnet, row, col);
}
);
}