-
Notifications
You must be signed in to change notification settings - Fork 28
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
Task 3, 3 test not passing #10
base: master
Are you sure you want to change the base?
Conversation
@@ -99,10 +98,12 @@ void Controller::handleTimePassed(const TimeoutInd&) | |||
|
|||
void Controller::handleDirectionChange(const DirectionInd& directionInd) | |||
{ | |||
auto direction = directionInd.direction; | |||
if(!isPauseOn){ |
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.
For smaller number of indentations just use if (isPauseOn) return; :)
@@ -152,17 +153,22 @@ void Controller::handleNewFood(const FoodResp& requestedFood) | |||
|
|||
bool Controller::doesCollideWithSnake(const Controller::Segment &newSegment) const | |||
{ | |||
if(!isPauseOn){ |
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.
Same as line 101
@@ -213,6 +219,14 @@ Controller::Segment Controller::getNewHead() const | |||
return newHead; | |||
} | |||
|
|||
void Controller::handlePause(const PauseInd& Pause) | |||
{ | |||
if(!Pause.isPauseOn) |
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.
You can just negate current isPauseOn value here
No description provided.