Add hex grid support (sides 3–10) for boards, pathfinding, LOS, and client rendering
- New HexGrid.cs: axial coord helpers, BFS neighbors, cube-lerp LOS, jump-range - Board: HexSides property, GetNeighbors() dispatches hex/square, IsInBounds() hex-aware - BoardShapeGenerator: MakeHexagon() with edge-based starting zones (2–6 players); FromTemplate() now carries HexSides through to the Board - Pathfinding: Walk/Flight BFS uses board.GetNeighbors() (hex+square unified) - LineOfSight: delegates to HexGrid.HasLos when hexSides > 0 - GameRules/GameRuleSet/BoardTemplate/BoardTemplateSnapshot: GridType + HexSides fields - GameMessages BoardDto: GridType + HexSides sent to client - GameEngine: PlaceArchSpirit range uses HexGrid.Distance on hex boards; Teleport LOS passes board.HexSides; ToBoardDto emits GridType/HexSides - EF migration 20260401000000_AddHexGridSupport: grid_type + hex_sides columns on game_rule_sets and board_templates; applied to pg-forge-01 - Client game_screen.gd: hex coord→world (pointy-top flat layout), CylinderMesh tiles (radial_segments=6), _board_distance cube metric, _bfs_reachable 6-dir, _client_has_los cube-lerp, highlight mesh for hex tiles; reads gridType/hexSides from BoardDto 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:
@@ -35,6 +35,15 @@ namespace SOR.Database.Migrations.Game
|
||||
b.Property<int>("Height")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("GridType")
|
||||
.IsRequired()
|
||||
.HasDefaultValue("Square")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("HexSides")
|
||||
.HasDefaultValue(0)
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("IsAvailableForCustom")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
@@ -281,9 +290,18 @@ namespace SOR.Database.Migrations.Game
|
||||
b.Property<bool>("FirstPlayerSkipsDraw")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("GridType")
|
||||
.IsRequired()
|
||||
.HasDefaultValue("Square")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("HandSizeCap")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("HexSides")
|
||||
.HasDefaultValue(0)
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("IsCustomDefault")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user