-
Notifications
You must be signed in to change notification settings - Fork 10
Improvements (continuous) #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
skiminki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this is the cleanest way
| if (!tab.m_tournament | ||
| && !game->pgn()->isNull() | ||
| && ( !game->pgn()->moves().isEmpty() // ignore empty games | ||
| || !game->pgn()->result().isNone())) // without adjudication | ||
| auto pgn = game->pgn(); | ||
|
|
||
| if (!tab.m_tournament && !pgn->isNull() | ||
| && (!pgn->moves().isEmpty() // ignore empty games | ||
| || !pgn->result().isNone())) // without adjudication |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation changes look unnecessary
| && !game->pgn()->isNull() | ||
| && ( !game->pgn()->moves().isEmpty() // ignore empty games | ||
| || !game->pgn()->result().isNone())) // without adjudication | ||
| auto pgn = game->pgn(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably should be a reference (auto const &pgn, for example), although I wouldn't make this change unless necessary
|
|
||
| QString evalString(const MoveEvaluation& eval, const Chess::Move& move); | ||
| QString statusString(const Chess::Move& move, bool doMove); | ||
| QString statusString(const Chess::Move& move, bool doMove); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks unnecessary
| m_restart_score(0), | ||
| m_strikes(0), | ||
| m_cuteseal(false) | ||
| m_restart_score(0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless there were warnings related to ordering, I wouldn't change anything here. (And if these fix warnings, better to isolate in a separate commit.)
| m_strikes(0), | ||
| m_cuteseal(false) | ||
| m_restart_score(0), | ||
| m_cuteseal(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
| int secondScore = pair->secondScore() + Tournament::playerAt(iBlack).builder()->resumescore(); | ||
| int leadScore = qMax(firstScore, secondScore); | ||
| int pointsInProgress = pair->gamesInProgress() * 2; | ||
| // int pointsInProgress = pair->gamesInProgress() * 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
| } | ||
|
|
||
| QTextStream& operator<<(QTextStream& out, const PgnGame& game) | ||
| QTextStream& operator<<(QTextStream& out, PgnGame& game) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't remove the const. It's confusing when operator << modifies its input parameters.
| const EngineConfiguration& config = m_engineManager->engineAt(engineIndex); | ||
|
|
||
| for (auto player : m_players) | ||
| for (auto &player : m_players) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary change
| file.resize(0); | ||
| } | ||
| // remove the "\n*\n\n" at the end of the file | ||
| else if (m_last_result == "*") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, the PGN standard says that an unterminated game ends in '*'
| { | ||
| lockCurrentGame(); | ||
| bool ok = m_tabs.at(m_tabBar->currentIndex()).m_pgn->write(fileName); | ||
| auto pgn = m_tabs.at(m_tabBar->currentIndex()).m_pgn; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent changes
I haven't tested it.