Switch hex polygon board from radius to side length

- Add HexSideLength property to BoardTemplate (tiles per edge)
- Add EF migration 20260406000000_AddBoardTemplateHexSideLength
- Replace NPolyInside (Euclidean circle test) with HexLine + flood-fill:
  * N corners placed at circumradius = (L-1)/(2·sin(π/N)) in hex-Cartesian
  * Corners snapped to nearest integer axial cell via HexRound
  * Perimeter built by hex-line lerp between adjacent corners
  * Interior determined by BFS flood-fill from center
- Auto-compute bounding hex radius from side length (max(L*2, ceil(circumR)+2))
- UI: expose Side Length input instead of Radius; canvas header shows L=n tiles/edge
- Zone tiles now walk along actual hex-line edges from each corner

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-04-06 18:16:03 -04:00
co-authored by Claude Sonnet 4.6
parent d28d02428d
commit 1feda0a59c
5 changed files with 705 additions and 86 deletions
@@ -42,6 +42,9 @@ namespace SOR.Database.Migrations.Game
b.Property<int>("HexPolygonSides")
.HasColumnType("integer");
b.Property<int>("HexSideLength")
.HasColumnType("integer");
b.Property<int>("HexSides")
.HasColumnType("integer");