refactored path point generation

exposed Pathfinder to Lua
This commit is contained in:
devZoGok
2026-03-15 15:21:11 +02:00
parent 03f9f9cc2e
commit 268ea14f4a
6 changed files with 75 additions and 15 deletions
+17
View File
@@ -19,6 +19,7 @@
#include "engineer.h"
#include "destructable.h"
#include "pointDefense.h"
#include "pathfinder.h"
#include "resourceDeposit.h"
using namespace std;
@@ -165,13 +166,29 @@ namespace battleship{
"multVec", [](Quaternion q, Vector3 v){return q * v;}
);
SOL_LUA_STATE.new_usertype<Map::Cell>(
"Cell",
"pos", &Map::Cell::pos,
"type", &Map::Cell::type
);
SOL_LUA_STATE.new_usertype<Map>(
"Map",
"getSingleton", &Map::getSingleton,
"getCell", &Map::getCell,
"getCells", &Map::getCells,
"getCellId", &Map::getCellId,
"getMapSize", &Map::getMapSize,
"getSpawnPoint", &Map::getSpawnPoint,
"getNumSpawnPoints", &Map::getNumSpawnPoints
);
SOL_LUA_STATE.new_usertype<Pathfinder>(
"Pathfinder",
"getSingleton", &Pathfinder::getSingleton,
"calcHeuristics", &Pathfinder::calcHeuristics,
"findPath", &Pathfinder::findPath
);
}
void GameManager::initLua(string gameDir){