add 'total_visited' to route & refactor

This commit is contained in:
MihailRis
2025-08-28 21:49:02 +03:00
parent 174a3c6871
commit fdf55ec64d
4 changed files with 81 additions and 64 deletions
+8
View File
@@ -10,9 +10,13 @@
#include <unordered_set>
#include <vector>
class Block;
class Level;
class GlobalChunks;
template <typename T>
class ContentUnitIndices;
namespace voxels {
struct RouteNode {
glm::ivec3 pos;
@@ -21,6 +25,7 @@ namespace voxels {
struct Route {
bool found;
std::vector<RouteNode> nodes;
int totalVisited;
};
struct Node {
@@ -75,9 +80,12 @@ namespace voxels {
private:
const Level& level;
const GlobalChunks& chunks;
const ContentUnitIndices<Block>& blockDefs;
std::unordered_map<int, Agent> agents;
int nextAgent = 1;
int getSurfaceAt(const glm::ivec3& pos, int maxDelta);
int checkPoint(int x, int y, int z);
};
}