| 341 | } |
| 342 | |
| 343 | void Agent::enterVehicle(GameState &state, StateRef<Vehicle> v) |
| 344 | { |
| 345 | if (v->getPassengers() >= v->getMaxPassengers()) |
| 346 | { |
| 347 | return; |
| 348 | } |
| 349 | if (currentBuilding) |
| 350 | { |
| 351 | currentBuilding->currentAgents.erase({&state, shared_from_this()}); |
| 352 | currentBuilding = nullptr; |
| 353 | } |
| 354 | if (currentVehicle) |
| 355 | { |
| 356 | currentVehicle->currentAgents.erase({&state, shared_from_this()}); |
| 357 | currentVehicle = nullptr; |
| 358 | } |
| 359 | currentVehicle = v; |
| 360 | currentVehicle->currentAgents.insert({&state, shared_from_this()}); |
| 361 | } |
| 362 | |
| 363 | bool Agent::canTeleport() const |
| 364 | { |
no test coverage detected