feat: started adding ability to set and draw racetracks

This commit is contained in:
Davide Passoni
2025-01-24 17:33:27 +01:00
parent 96415fd087
commit c2ea746d48
9 changed files with 154 additions and 20 deletions

View File

@@ -353,6 +353,16 @@ void Scheduler::handleRequest(string key, json::value value, string username, js
unit->setDesiredAltitudeType(to_string(value[L"altitudeType"]));
log(username + " set " + unit->getUnitName() + "(" + unit->getName() + ") altitude type: " + to_string(value[L"altitudeType"]), true);
}
}/************************/
else if (key.compare("setRacetrackLength") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr) {
unit->setRacetrackLength(value[L"racetrackLength"].as_double());
log(username + " set " + unit->getUnitName() + "(" + unit->getName() + ") racetrack length: " + to_string(value[L"racetrackLength"].as_double()), true);
}
}
/************************/
else if (key.compare("cloneUnits") == 0)