Cleanup: remove unused code from four files#3234
Merged
DevelopingTom merged 1 commit intomainfrom Feb 18, 2026
Merged
Conversation
4 tasks
Contributor
WalkthroughThis pull request removes PlayerActions-related code from graphics layers and eliminates two optional metadata properties (canBuildTrainStation and experimental) from the UnitInfo interface and its default configuration, simplifying the unit system. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
This was referenced Feb 18, 2026
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 18, 2026
## Description: PR 3/x in effort to break up PR #3220. Follows on already merged #3233 and #3234. Please see if these can be merged for v30. - **ClientGameRunner**: removed two redundant myPlayer===null checks since that was already done right above, instead use !. - **BuildMenu**: just like in UnitDisplay, assign public PlayerActions default value of null. So that in canCreateOrBuild, where we already do a === null check on it btw, we can safely skip the assignment to const buildableUnits and just directly loop over this.playerActions.buildableUnits. - **RadialMenuElements**: don't call canBuildOrUpgrade 3x in CreateMenuElements for the .map on flattenedBuildTable, instead do it once and re-use outcome. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: tryout33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
PR 2/x in effort to break up PR #3220. Follows on #3233. Precedes #3235.
Please see if these can be merged for v30.
Removes unused code and properties.
Game.ts and DefaultConfig unitInfo: removed canBuildTrainStation and expirimental properties, as they weren't used anywhere anymore.
PlayerActionHandler: remove unused getPlayerActions, the only potential caller MainRadialMenu already just calls myPlayer.actions via GameView directly.
StructureIconsLayer: remove unused PlayerActions
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
tryout33