mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:57:44 +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;
|
||||
switch (event.key()) {
|
||||
case Key_A:
|
||||
[[fallthrough]];
|
||||
case Key_Left:
|
||||
m_paddle.moving_left = false;
|
||||
break;
|
||||
case Key_D:
|
||||
[[fallthrough]];
|
||||
case Key_Right:
|
||||
m_paddle.moving_right = false;
|
||||
break;
|
||||
|
@ -174,10 +176,12 @@ void Game::keydown_event(GUI::KeyEvent& event)
|
|||
GUI::Application::the()->quit();
|
||||
break;
|
||||
case Key_A:
|
||||
[[fallthrough]];
|
||||
case Key_Left:
|
||||
m_paddle.moving_left = true;
|
||||
break;
|
||||
case Key_D:
|
||||
[[fallthrough]];
|
||||
case Key_Right:
|
||||
m_paddle.moving_right = true;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue