mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:07:45 +00:00
Breakout: Tag fallthrough statement
Tag key changes with fallthrough statement to document the intention.
This commit is contained in:
parent
ef3f9b24dd
commit
567104607c
1 changed files with 4 additions and 0 deletions
|
@ -153,10 +153,12 @@ void Game::keyup_event(GUI::KeyEvent& event)
|
||||||
return;
|
return;
|
||||||
switch (event.key()) {
|
switch (event.key()) {
|
||||||
case Key_A:
|
case Key_A:
|
||||||
|
[[fallthrough]];
|
||||||
case Key_Left:
|
case Key_Left:
|
||||||
m_paddle.moving_left = false;
|
m_paddle.moving_left = false;
|
||||||
break;
|
break;
|
||||||
case Key_D:
|
case Key_D:
|
||||||
|
[[fallthrough]];
|
||||||
case Key_Right:
|
case Key_Right:
|
||||||
m_paddle.moving_right = false;
|
m_paddle.moving_right = false;
|
||||||
break;
|
break;
|
||||||
|
@ -174,10 +176,12 @@ void Game::keydown_event(GUI::KeyEvent& event)
|
||||||
GUI::Application::the()->quit();
|
GUI::Application::the()->quit();
|
||||||
break;
|
break;
|
||||||
case Key_A:
|
case Key_A:
|
||||||
|
[[fallthrough]];
|
||||||
case Key_Left:
|
case Key_Left:
|
||||||
m_paddle.moving_left = true;
|
m_paddle.moving_left = true;
|
||||||
break;
|
break;
|
||||||
case Key_D:
|
case Key_D:
|
||||||
|
[[fallthrough]];
|
||||||
case Key_Right:
|
case Key_Right:
|
||||||
m_paddle.moving_right = true;
|
m_paddle.moving_right = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue