Spend Kitchelin Star to Remove Pillar - #137
Conversation
- Add `isRemovePillarModeActive` and `lastShakeTimeMs` to `GameState`. - Implement "Remove Pillar" action in `StarActionOverlay`. - Add pillar removal logic and mode management in `MainViewModel`. - Update `onCellClick` to support pillar destruction. - Add pulsing pillar highlights in `GameBoard` during destruction mode. - Implement screen shake effect and cancel button in `MainActivity`. - Add unit test `RemovePillarTest.kt`. Co-authored-by: candour <4670475+candour@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR introduces a pillar removal mode to the game, allowing players to spend Kitchelin stars to convert pillar tiles into floor tiles. The feature includes game state properties, view model logic for mode control and pillar removal, UI integration with shake animations and button overlays, and comprehensive unit test coverage. ChangesPillar Removal Mode Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
- Implemented "Remove Pillar" star action in `StarActionOverlay`. - Added logic in `MainViewModel` to handle pillar removal and star deduction. - Included pulsing highlight for pillars in `GameBoard` when in removal mode. - Added screen shake and cancel button in `MainActivity`. - Added unit test `RemovePillarTest.kt` for verification. Co-authored-by: candour <4670475+candour@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
app/src/test/java/com/messark/hawker/RemovePillarTest.kt (1)
90-96: ⚡ Quick winComplete the no-star test with an explicit mode assertion and remove exploratory comments.
The test currently leaves Line 93-96 as draft notes. Add a concrete assertion for the intended mode behavior so this path is fully locked down.
✅ Suggested test cleanup
val state = viewModel.gameState.value assertEquals(0, state.kitchelinStars) assertEquals(TileType.PILLAR, state.hexes[pillarCoord]?.type) - // It stays in mode because nothing happened (though currently removePillar returns early) - // Actually my implementation of removePillar sets isRemovePillarModeActive = false ONLY if it succeeds. - // Let's check my code again. + assertTrue(state.isRemovePillarModeActive)app/src/main/java/com/messark/hawker/ui/components/StarActionOverlay.kt (1)
107-115: 🏗️ Heavy liftUse
SpriteButtonfor the new “Remove Pillar” action.This new action is currently rendered with
StarActionButton; project guidance requiresSpriteButtonfor action buttons.As per coding guidelines, "Use
SpriteButtonfor all action buttons and referencebuttons.pngfor visual consistency".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4a2da6a5-97a7-47e1-92b2-18b2e2e1f10d
📒 Files selected for processing (6)
app/src/main/java/com/messark/hawker/MainActivity.ktapp/src/main/java/com/messark/hawker/MainViewModel.ktapp/src/main/java/com/messark/hawker/model/GameModels.ktapp/src/main/java/com/messark/hawker/ui/components/GameBoard.ktapp/src/main/java/com/messark/hawker/ui/components/StarActionOverlay.ktapp/src/test/java/com/messark/hawker/RemovePillarTest.kt
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
- Implemented "Remove Pillar" star action in `StarActionOverlay`. - Added logic in `MainViewModel` to handle pillar removal and star deduction. - Included pulsing highlight for pillars in `GameBoard` when in removal mode. - Added screen shake and cancel button in `MainActivity`. - Refactored `MainViewModel` to move `triggerHaptic()` and `handleGameOver()` calls outside of `_gameState.update` blocks for better concurrency safety. - Captured timestamps before state updates for consistency. - Added unit test `RemovePillarTest.kt`. Co-authored-by: candour <4670475+candour@users.noreply.github.com>
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
|
@coderabbitai resolve |
✅ Actions performedComments resolved and changes approved. |
This change allows users to spend one Kitchelin Star to permanently remove a pillar from the board.
Key features:
PR created automatically by Jules for task 9886608132369605701 started by @candour
Summary by CodeRabbit
New Features