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:
@@ -33,9 +33,8 @@ public static class Pathfinding
|
||||
var (current, cost) = queue.Dequeue();
|
||||
if (cost >= maxMp) continue;
|
||||
|
||||
foreach (var neighbor in current.OrthogonalNeighbors())
|
||||
foreach (var neighbor in board.GetNeighbors(current))
|
||||
{
|
||||
if (!board.IsInBounds(neighbor)) continue;
|
||||
if (blocked.Contains(neighbor)) continue;
|
||||
if (result.ContainsKey(neighbor)) continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user