Separate polygon sides from board radius for hex templates; fix template IsInBounds
- HexSides now stores radius+1 (for hex coordinate math); HexPolygonSides stores the corner count (3–10) - Board.IsTemplateBased: template boards use tile existence for IsInBounds/GetNeighbors instead of the hexagonal formula, so N-gon and other custom shapes work correctly - HexGrid.AllNeighbors: unfiltered 6-neighbor generator for template board use - ApplyHexConfig: generates a regular N-gon on the hex canvas — tiles outside the polygon are marked absent; N corner zones auto-generated for each player count 2..N - Admin builder UI: separate "Polygon Sides" (3–10 corners) and "Radius (tiles)" inputs - BoardTemplate entity and migration: HexPolygonSides column added to board_templates - BoardTemplateDto exposes HexPolygonSides to client Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -209,8 +209,9 @@ public sealed record BoardTemplateDto(
|
||||
bool IsAvailableForCustom,
|
||||
string TilesJson,
|
||||
string StartingZonesJson,
|
||||
string GridType = "Square",
|
||||
int HexSides = 0);
|
||||
string GridType = "Square",
|
||||
int HexSides = 0,
|
||||
int HexPolygonSides = 6);
|
||||
|
||||
// ── BGM config ───────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ internal sealed class ContentBoardTemplatesHandler : IMessageHandler
|
||||
t.TilesJson,
|
||||
t.StartingZonesJson,
|
||||
t.GridType,
|
||||
t.HexSides))
|
||||
t.HexSides,
|
||||
t.HexPolygonSides))
|
||||
.ToListAsync(ct);
|
||||
|
||||
return ServerMessage.Reply(
|
||||
|
||||
Reference in New Issue
Block a user