Skip to content

roads and bridges#82

Merged
anton-makarevich merged 6 commits into
mainfrom
feat/47-roads-and-bridges
Jul 16, 2026
Merged

roads and bridges#82
anton-makarevich merged 6 commits into
mainfrom
feat/47-roads-and-bridges

Conversation

@anton-makarevich

@anton-makarevich anton-makarevich commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Added a Road/Bridge editing tool for placing roads on land and bridges over water.
    • Added controls to raise or lower bridge height.
    • Added controls to adjust bridge construction factor.
    • Improved terrain layering so roads, bridges, water, and other terrain combine correctly.
    • Added bridge and road details to the hex information overlay.
  • Release
    • Updated the application version to 0.7.0.

@anton-makarevich anton-makarevich linked an issue Jul 16, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The map editor adds road and bridge terrain editing, bridge height and construction controls, bridge-aware hex state, updated terrain layering, rendering refresh behavior, localization strings, tests, and a project version update.

Changes

Road and bridge editing

Layer / File(s) Summary
Terrain layering and road bridge tool
src/MakaMek.MapEditor/Models/ToolType.cs, src/MakaMek.MapEditor/ViewModels/EditMapViewModel.cs, tests/MakaMek.MapEditor.Test/ViewModels/EditMapViewModelTests.cs
Adds the RoadBridge tool and applies road, bridge, water, and ground-terrain layering rules.
Bridge commands and observable state
src/MakaMek.MapEditor/ViewModels/EditMapViewModel.cs, src/MakaMek.MapEditor/ViewModels/Wrappers/HexViewModel.cs, src/MakaMek.MapEditor/Controls/HexInfoOverlay.axaml, src/MakaMek.MapEditor/Services/MapEditorFakeLocalizationService.cs, tests/MakaMek.MapEditor.Test/ViewModels/{EditMapViewModelTests.cs,Wrappers/HexViewModelTests.cs}
Adds bridge height and construction-factor commands, exposes bridge state, and binds the values and commands in the overlay.
Terrain render data refresh
src/MakaMek.MapEditor/Views/EditMapView.axaml.cs
Delegates render-data creation to TerrainBitmaskService and refreshes neighbor caches when complete render data changes.
Editing behavior regression coverage
tests/MakaMek.MapEditor.Test/ViewModels/EditMapViewModelTests.cs
Updates selection expectations and covers road/bridge placement, terrain combinations, command bounds, events, and tool selection.

Project version update

Layer / File(s) Summary
Shared build version
Directory.Build.props
Changes the project-wide version from 0.6.18 to 0.7.0.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Editor as HexInfoOverlay
  participant ViewModel as EditMapViewModel
  participant Map as IBattleMap
  participant HexState as HexViewModel
  Editor->>ViewModel: execute bridge height or construction command
  ViewModel->>Map: replace edited hex
  ViewModel->>HexState: update bridge properties
  ViewModel-->>Editor: raise HexUpdated
Loading

Possibly related PRs

Suggested labels: feature

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.70% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is related to the change, but it is too vague to clearly describe the main update. Use a more specific title such as "Add road and bridge editing support" to reflect the main behavior change.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/47-roads-and-bridges

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/MakaMek.MapEditor/ViewModels/EditMapViewModel.cs`:
- Around line 424-454: Update IsGroundTerrain and the ApplyTerrainToHex
ground-layer logic so Clear is treated as a ground terrain. When applying Woods,
Rough, Pavement, Rubble, or another ground terrain to a clear hex, remove the
existing Clear layer before adding the new terrain, while preserving
ground-layer exclusivity.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3d32cc73-469d-4e49-94a7-645c9cf4044d

📥 Commits

Reviewing files that changed from the base of the PR and between 91d93de and 9693c41.

📒 Files selected for processing (9)
  • Directory.Build.props
  • src/MakaMek.MapEditor/Controls/HexInfoOverlay.axaml
  • src/MakaMek.MapEditor/Models/ToolType.cs
  • src/MakaMek.MapEditor/Services/MapEditorFakeLocalizationService.cs
  • src/MakaMek.MapEditor/ViewModels/EditMapViewModel.cs
  • src/MakaMek.MapEditor/ViewModels/Wrappers/HexViewModel.cs
  • src/MakaMek.MapEditor/Views/EditMapView.axaml.cs
  • tests/MakaMek.MapEditor.Test/ViewModels/EditMapViewModelTests.cs
  • tests/MakaMek.MapEditor.Test/ViewModels/Wrappers/HexViewModelTests.cs

Comment thread src/MakaMek.MapEditor/ViewModels/EditMapViewModel.cs
@anton-makarevich
anton-makarevich merged commit 56b3eae into main Jul 16, 2026
6 checks passed
@anton-makarevich
anton-makarevich deleted the feat/47-roads-and-bridges branch July 16, 2026 07:36
@coderabbitai coderabbitai Bot mentioned this pull request Jul 16, 2026
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.

Add roads and bridges

1 participant