mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 04:51:49 +00:00
add 'total_visited' to route & refactor
This commit is contained in:
parent
174a3c6871
commit
fdf55ec64d
4 changed files with 81 additions and 64 deletions
|
|
@ -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);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue