mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
add pathfinding.remove_agent
This commit is contained in:
parent
3aac6ecbcb
commit
5a6537c89d
3 changed files with 17 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue