Add minimal number of moves statistics
ClosedPublic

Authored by piotrkakol on Dec 1 2019, 1:10 AM.

Details

Summary

Statistics that displays the minimal number of moves that a player used to win a game. This could be used to make the game more competitive - comparing your score to other people's.

The number is set to -1 (which is unachievable) when reseting the statistics and an infinity symbol is then displayed.

Diff Detail

Repository
R410 KPatience
Lint
Lint Skipped
Unit
Unit Tests Skipped
piotrkakol created this revision.Dec 1 2019, 1:10 AM
Restricted Application added a reviewer: KDE Games. · View Herald TranscriptDec 1 2019, 1:10 AM
Restricted Application added a subscriber: kde-games-devel. · View Herald Transcript
piotrkakol requested review of this revision.Dec 1 2019, 1:10 AM
piotrkakol edited the summary of this revision. (Show Details)Dec 1 2019, 1:15 AM
aacid added a subscriber: aacid.Dec 1 2019, 9:53 PM
aacid added inline comments.
statisticsdialog.cpp
125

Shouldn't that 0 be -1 ?

Otherwise for already recorded stats you'll get a 0, no?

piotrkakol updated this revision to Diff 70710.Dec 2 2019, 12:26 AM

Changed the default value set to minmoves from 0 to -1 thanks to aacid's comment.

aacid added inline comments.Dec 2 2019, 11:21 PM
dealer.cpp
1751

shouldn't this be -1 too?

piotrkakol updated this revision to Diff 70827.Dec 3 2019, 2:26 PM
piotrkakol marked an inline comment as done.
aacid added a comment.Dec 9 2019, 10:08 PM

Can you confirmed you've actually tried this?

Because i found 2 places where if you would have tried it, it would have not worked, so i'm a bit puzzled as to how much testing this patch got at all

piotrkakol marked an inline comment as done.Dec 18 2019, 9:27 PM

Yes, I have tried it. At first I just launched the game and checked if the functionality worked. After your last comment I deleted all files and checked all scenarios I could think of from the start. I'm sorry that I didn't do it before I submitted this diff. I didn't think about the initial state of the game.

Also, I have replied to both of your comments inline. I can't see my comments, though, when I'm not logged in. Don't know if you can see them when you're logged in (unintuitive, if they somehow are not visible for logged in users). Here they are:

You're correct. When the game is first launched after the update the starting value would be 0 instead of -1 and would never be updated. Thank you.
You're right again. Sorry that I didn't reread the entire code after your first comment. Reread it now and changed 1 more thing. I couldn't find a scenario, though, in which this 0 would be a problem (but of course better safe than sorry with -1).

dealer.cpp
1751

You're right again. Sorry that I didn't reread the entire code after your first comment. Reread it now and changed 1 more thing. I couldn't find a scenario, though, in which this 0 would be a problem (but of course better safe than sorry with -1).

statisticsdialog.cpp
125

You're correct. When the game is first launched after the update the starting value would be 0 instead of -1 and would never be updated. Thank you.

aacid accepted this revision.Jan 2 2020, 11:38 PM

Ok, let's go for it :)

This revision is now accepted and ready to land.Jan 2 2020, 11:38 PM
This revision was automatically updated to reflect the committed changes.