RecordPtr CommitSession::PopAndUndoRecord() { Open(); RecordPtr pRec = m_game.PopRecord(); pRec->Undo(m_game, &m_controller); m_bUpdateReviewUI |= !pRec->IsMessageRecord(); Output::RemoveLog output(pRec->GetID()); m_controller.SendMessage(output, m_game); for (auto& g : m_game.GetReviewGames()) m_controller.SendMessage(output, *g); return pRec; }
void CommitSession::DoAndPushRecord(RecordPtr pRec) { Open(); pRec->Do(m_game, &m_controller); m_bUpdateReviewUI |= !pRec->IsMessageRecord(); std::string msg = pRec->GetMessage(m_game); int id = m_game.PushRecord(std::move(pRec)); ASSERT(!msg.empty()); Output::AddLog output(id, msg); m_controller.SendMessage(output, m_game); for (auto& g : m_game.GetReviewGames()) m_controller.SendMessage(output, *g); }