work no minimap

This commit is contained in:
Boki 2026-02-16 14:41:15 -05:00
parent 3087f9146e
commit 7d10f1d2a9
4 changed files with 70 additions and 5 deletions

View file

@ -459,6 +459,39 @@ public class WorldMap : IDisposable
colored.Set(r, c, new Vec3b(55, 40, 28));
}
// BFS overlay: frontier cells + direction line
var bfs = _pathFinder.LastResult;
if (bfs != null)
{
// Other frontier directions (dim cyan)
foreach (var pt in bfs.OtherFrontier)
{
var vx = pt.X - x0;
var vy = pt.Y - y0;
if (vx >= 0 && vx < viewSize && vy >= 0 && vy < viewSize)
colored.Set(vy, vx, new Vec3b(100, 80, 0));
}
// Best frontier direction (bright green)
foreach (var pt in bfs.BestFrontier)
{
var vx = pt.X - x0;
var vy = pt.Y - y0;
if (vx >= 0 && vx < viewSize && vy >= 0 && vy < viewSize)
colored.Set(vy, vx, new Vec3b(0, 220, 0));
}
// Direction line from player
var px2 = bfs.PlayerCx - x0;
var py2 = bfs.PlayerCy - y0;
var lineLen = 60;
var ex = (int)(px2 + bfs.DirX * lineLen);
var ey = (int)(py2 + bfs.DirY * lineLen);
Cv2.ArrowedLine(colored, new Point(px2, py2), new Point(ex, ey),
new Scalar(0, 220, 0), 2, tipLength: 0.3);
}
// Player dot (orange, on top)
var px = cx - x0;
var py = cy - y0;
if (px >= 0 && px < viewSize && py >= 0 && py < viewSize)