public void Invoke(DirectedPath path, Hexside hexside)
            {
                var here  = path.PathStep.Hex;
                var there = here.Board[here.Coords.GetNeighbour(hexside)];

                if (there != null && !_open.ContainsKey(there.Coords))
                {
                    var cost = _stepCost(there, hexside.Reversed());
                    if (cost > 0)
                    {
                        var newPath  = path.AddStep(there, hexside, cost);
                        var estimate = Estimate(_heuristic, _vectorGoal, _start.Coords, newPath.PathStep.Hex.Coords, newPath.TotalCost);
                        TraceFlags.FindPathEnqueue.Trace("   Enqueue {0}: estimate={1,4}:{2,3}",
                                                         there.Coords, estimate >> 16, estimate & 0xFFFF);
                        _queue.Enqueue(estimate, newPath);
                    }
                }
            }
Пример #2
0
 protected override Hexside HexsideDirection(Hexside hexside)
 {
     return(hexside.Reversed());
 }