Skip to content

City combat refactor#19

Open
Rewenix wants to merge 7 commits into
mainfrom
city_combat
Open

City combat refactor#19
Rewenix wants to merge 7 commits into
mainfrom
city_combat

Conversation

@Rewenix

@Rewenix Rewenix commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR refactors several features that were developed earlier on the city_combat branch, with the goal of making the existing city combat and client UI behavior easier to reason about.

Changes

  • Refactored the pure combat resolver to keep city state in mutable city snapshots instead of parallel HP/owner maps.
  • Simplified city melee resolution and removed an unnecessary too_many_arguments allowance.
  • Updated combat system comments to better describe the city HP, ownership, and movement resolution flow.
  • Moved client city selection into UiState::CitySelected instead of storing it separately in Controller.
  • Added UiState::GameFinished { outcome } so win/loss UI and input blocking are driven by one local UI state.
  • Simplified UI systems by removing repeated DefeatedPlayer / VictoriousPlayer checks from action bars, production controls, turn text, and lobby start handling.
  • Prevented map click handling from running when the mouse is over UI buttons, fixing action/production button clicks being swallowed by handle_left_click.
  • Adjusted lobby visibility so defeated players do not make the lobby appear before the active game has ended.

Testing

  • cargo check -p client
  • cargo clippy -p client --all-targets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant