-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
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.
Good work! I see you found a simpler solution to set_position()
than should have been, but I'll let it slide - I should have made an issue like #52 as a Depend on this one.
Please do have a look at and commit my suggestions, then you can merge 👍
player.cpp
Outdated
m_line_x_position = line_x_position; | ||
} | ||
|
||
void player::score(double line_x_position) { |
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.
void player::score(double line_x_position) { | |
void player::score(const double& line_x_position) { |
We don't need to change the line position here, so let's be clear about that :)
void player::set_position(double line_x_position) { | ||
m_line_x_position = line_x_position; | ||
} |
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 the intended solution by the test (the field's line should probably not be a property of the player!), but it does address the test. I'll allow it for now, eventually we'll have to break this (in #52).
player.h
Outdated
double get_x() const noexcept { return m_x; } | ||
double get_y() const noexcept { return m_y; } | ||
|
||
int get_score() const noexcept; | ||
void set_score(const int new_score); | ||
|
||
void set_position(double line_x_position); | ||
void score(double line_x_position); |
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.
void score(double line_x_position); | |
void score(const double& line_x_position); |
player.cpp
Outdated
m_x{0}, | ||
m_y{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.
m_x{0}, | |
m_y{0}, | |
m_x{0.0}, | |
m_y{0.0}, |
Good practice: the .0, although useless, confirms to humans this is a float and not an integer 😉
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.
now i changed it back there are no problems but when we were working on the issue we had a weird error and this fixed it.
Co-authored-by: Théo Pannetier <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #51 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 83 114 +31
Branches 0 1 +1
=========================================
+ Hits 83 114 +31 ☔ View full report in Codecov by Sentry. |
we finished issue #39