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:
@@ -649,7 +649,9 @@ public sealed record BoardDto(
|
||||
int Height,
|
||||
IEnumerable<TileDto> Tiles,
|
||||
/// <summary>Seat index → list of valid ArchSpirit placement coords. Empty for legacy 1v1.</summary>
|
||||
Dictionary<int, IEnumerable<CoordDto>>? StartingZones = null);
|
||||
Dictionary<int, IEnumerable<CoordDto>>? StartingZones = null,
|
||||
string GridType = "Square",
|
||||
int HexSides = 0);
|
||||
|
||||
public sealed record TileDto(
|
||||
CoordDto Coord,
|
||||
|
||||
Reference in New Issue
Block a user