3#include <glog/logging.h>
16 std::shared_ptr<CreepersParams> params_;
17 std::vector<std::shared_ptr<Creeper>> creepers_;
18 std::vector<std::shared_ptr<Creeper>> actives_;
42 [[nodiscard]]
const decltype(creepers_)&
getCreepers()
const {
return creepers_; }
56 template <
typename Units>
58#pragma omp parallel for
59 for (
auto i = 0; i < actives_.size(); ++i) {
60 for (
const auto& unit : units) {
61 if (
static_cast<Unit*
>(actives_[i].get()) !=
static_cast<Unit*
>(unit.get())) {
62 actives_[i]->updateState(unit);
Manages a collection of creeper entities and their interactions.
Definition CreepersManager.hpp:15
void refreshActives()
Refreshes the list of active creepers.
Definition CreepersManager.cpp:29
decltype(creepers_) & getCreepersRef()
Provides access to the collection of all creepers.
Definition CreepersManager.hpp:25
void walk()
Executes the walking behavior for all creepers.
Definition CreepersManager.cpp:22
void beginAndFindSteves(const std::vector< std::shared_ptr< Steve > > &steves)
Initializes creepers and associates them with nearby Steves.
Definition CreepersManager.cpp:12
const decltype(creepers_) & getCreepers() const
Provides constant access to the collection of all creepers.
Definition CreepersManager.hpp:42
friend Simulation
Definition CreepersManager.hpp:68
void interactWith(Units units)
Allows creepers to interact with a collection of other units.
Definition CreepersManager.hpp:57
Main controller for managing the simulation of creepers and Steves.
Definition Simulation.hpp:16
Represents a generic unit in the simulation.
Definition Unit.hpp:63