Units move using the new pathfinding system

Minor refactoring
This commit is contained in:
devZoGok
2022-08-27 19:22:13 +03:00
parent 5d4803b083
commit e33919160f
14 changed files with 127 additions and 58 deletions
+2 -1
View File
@@ -31,6 +31,7 @@ namespace battleship{
speed = new float[numUnits];
destinationOffset = new float[numUnits];
unitType = new UnitType[numUnits];
unitClass = new UnitClass[numUnits];
anglePrecision = new float[numUnits];
cost = new int[numUnits];
maxTurnAngle = new float[numUnits];
@@ -46,7 +47,7 @@ namespace battleship{
for(int i = 0; i < numUnits; i++){
health[i] = luaManager->getIntFromTable("health", vector<Index>{Index(to_string(i + 1), false)});
speed[i] = luaManager->getFloatFromTable("speed", vector<Index>{Index(to_string(i + 1), false)});
unitType[i] = (UnitType)luaManager->getIntFromTable("unitType", vector<Index>{Index(to_string(i + 1), false)});
unitClass[i] = (UnitClass)luaManager->getIntFromTable("unitClass", vector<Index>{Index(to_string(i + 1), false)});
destinationOffset[i] = luaManager->getFloatFromTable("destinationOffset", vector<Index>{Index(to_string(i + 1), false)});
anglePrecision[i] = luaManager->getFloatFromTable("anglePrecision", vector<Index>{Index(to_string(i + 1), false)});
cost[i] = luaManager->getIntFromTable("cost", vector<Index>{Index(to_string(i + 1), false)});