add pathfinding.remove_agent
This commit is contained in:
@@ -63,6 +63,15 @@ int Pathfinding::createAgent() {
|
||||
return id;
|
||||
}
|
||||
|
||||
bool Pathfinding::removeAgent(int id) {
|
||||
auto found = agents.find(id);
|
||||
if (found != agents.end()) {
|
||||
agents.erase(found);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Pathfinding::performAllAsync(int stepsPerAgent) {
|
||||
for (auto& [id, agent] : agents) {
|
||||
if (agent.state.finished) {
|
||||
|
||||
Reference in New Issue
Block a user