|
|
|
@ -3,25 +3,25 @@ |
|
|
|
|
void GameListener::accept(GameEvent *event) { |
|
|
|
|
if (auto wallJumpEvent = dynamic_cast<WallJumpEvent *>(event)) |
|
|
|
|
OnWallJumped(wallJumpEvent); |
|
|
|
|
if (auto wallCrashEvent = dynamic_cast<WallCrashEvent *>(event)) |
|
|
|
|
else if (auto wallCrashEvent = dynamic_cast<WallCrashEvent *>(event)) |
|
|
|
|
OnWallCrashed(wallCrashEvent); |
|
|
|
|
if (auto coinCollectEvent = dynamic_cast<CoinCollectEvent *>(event)) |
|
|
|
|
else if (auto coinCollectEvent = dynamic_cast<CoinCollectEvent *>(event)) |
|
|
|
|
OnCoinCollected(coinCollectEvent); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void InputListener::accept(InputEvent *event) { |
|
|
|
|
if (auto mousePress = dynamic_cast<MousePressEvent *>(event)) |
|
|
|
|
mousePressed(mousePress); |
|
|
|
|
if (auto mouseRelease = dynamic_cast<MouseReleaseEvent *>(event)) |
|
|
|
|
else if (auto mouseRelease = dynamic_cast<MouseReleaseEvent *>(event)) |
|
|
|
|
mouseReleased(mouseRelease); |
|
|
|
|
if (auto mouseDoubleClick = dynamic_cast<MouseDoubleClickEvent *>(event)) |
|
|
|
|
else if (auto mouseDoubleClick = dynamic_cast<MouseDoubleClickEvent *>(event)) |
|
|
|
|
mouseDoubleClicked(mouseDoubleClick); |
|
|
|
|
if (auto mouseMove = dynamic_cast<MouseMoveEvent *>(event)) |
|
|
|
|
else if (auto mouseMove = dynamic_cast<MouseMoveEvent *>(event)) |
|
|
|
|
mouseMoved(mouseMove); |
|
|
|
|
if (auto keyPress = dynamic_cast<KeyPressEvent *>(event)) |
|
|
|
|
else if (auto keyPress = dynamic_cast<KeyPressEvent *>(event)) |
|
|
|
|
keyPressed(keyPress); |
|
|
|
|
if (auto keyRelease = dynamic_cast<KeyReleaseEvent *>(event)) |
|
|
|
|
else if (auto keyRelease = dynamic_cast<KeyReleaseEvent *>(event)) |
|
|
|
|
keyReleased(keyRelease); |
|
|
|
|
if (auto wheel = dynamic_cast<WheelEvent *>(event)) |
|
|
|
|
else if (auto wheel = dynamic_cast<WheelEvent *>(event)) |
|
|
|
|
mouseWheel(wheel); |
|
|
|
|
} |
|
|
|
|