This commit is contained in:
devZoGok
2024-01-06 12:38:25 +02:00
parent ad5e71d00d
commit b3ea94629d
3 changed files with 15 additions and 15 deletions
+3 -3
View File
@@ -10,10 +10,10 @@ namespace battleship{
static Pathfinder *pathfinder = nullptr;
Pathfinder* Pathfinder::getSingleton(){
if(!pathfinder)
pathfinder = new Pathfinder();
if(!pathfinder)
pathfinder = new Pathfinder();
return pathfinder;
return pathfinder;
}
int Pathfinder::findMinDistVert(vector<Map::Cell> &cells, u32 distances[]){
+11 -11
View File
@@ -8,18 +8,18 @@
#include <util.h>
namespace battleship{
class Pathfinder{
public:
static Pathfinder* getSingleton();
std::vector<int> findPath(std::vector<Map::Cell>&, int, int, int = -1);
inline vb01::u32 getImpassibleNodeVal(){return impassibleNodeVal;}
inline void setImpassibleNodeVal(vb01::u32 val){this->impassibleNodeVal = val;}
private:
Pathfinder(){}
int findMinDistVert(std::vector<Map::Cell>&, vb01::u32[]);
class Pathfinder{
public:
static Pathfinder* getSingleton();
std::vector<int> findPath(std::vector<Map::Cell>&, int, int, int = -1);
inline vb01::u32 getImpassibleNodeVal(){return impassibleNodeVal;}
inline void setImpassibleNodeVal(vb01::u32 val){this->impassibleNodeVal = val;}
private:
Pathfinder(){}
int findMinDistVert(std::vector<Map::Cell>&, vb01::u32[]);
vb01::u32 impassibleNodeVal;
};
vb01::u32 impassibleNodeVal;
};
}
#endif
+1 -1
View File
@@ -54,7 +54,7 @@ namespace battleship{
}
void PathfinderTest::testFindBigPath(){
int numIterations = 10;
int numIterations = 1;
cells = generateCellGraph(60);
s64 sumTime = 0;