Expeditions rework (#18960)

This commit is contained in:
metalgearsloth
2023-09-19 22:52:01 +10:00
committed by GitHub
parent 86fa8ae180
commit 036b9ef74f
40 changed files with 774 additions and 1097 deletions

View File

@@ -83,17 +83,14 @@ public sealed partial class DungeonJob
var lastDirection = new Dictionary<Vector2i, Direction>();
costSoFar[start] = 0f;
lastDirection[start] = Direction.Invalid;
var tagQuery = _entManager.GetEntityQuery<TagComponent>();
// TODO:
// Pick a random node to start
// Then, dijkstra out from it. Add like +10 if it's a wall or smth
// When we hit another cable then mark it as found and iterate cameFrom and add to the thingie.
while (remaining.Count > 0)
{
if (frontier.Count == 0)
{
frontier.Enqueue(remaining.First(), 0f);
var newStart = remaining.First();
frontier.Enqueue(newStart, 0f);
lastDirection[newStart] = Direction.Invalid;
}
var node = frontier.Dequeue();