30 CreepersParams(
double moveRadius,
double explodeRadius,
const std::shared_ptr<FieldParams> &fieldParams,
40class Creeper final :
public Unit,
public std::enable_shared_from_this<Creeper> {
41 std::shared_ptr<CreepersParams> params_;
43 std::shared_ptr<Steve> target_;
63 Creeper(
size_t id,
const std::shared_ptr<CreepersParams> ¶ms);
72 void steveSearch(
const std::shared_ptr<Steve> &steve);
78 void updateState(
const std::shared_ptr<Unit> &another)
override;
82 [[nodiscard]]
decltype(state_)
getState()
const {
return state_; }
Represents an individual creeper in the simulation.
Definition Creeper.hpp:40
void begin()
Initializes the creeper's behavior.
Definition Creeper.cpp:14
void walk() override
Executes the walking behavior of the creeper.
Definition Creeper.cpp:70
void steveSearch(const std::shared_ptr< Steve > &steve)
Searches for a Steve target.
Definition Creeper.cpp:34
void die() override
Executes the death behavior of the unit.
Definition Creeper.cpp:106
decltype(state_) getState() const
Definition Creeper.hpp:82
void updateState(const std::shared_ptr< Unit > &another) override
Updates the state of the unit based on interaction with another unit.
Definition Creeper.cpp:108
Configuration parameters for creepers in the simulation.
Definition Creeper.hpp:14
static constexpr size_t creepers_num_changing_state
Definition Creeper.hpp:22
State
Possible states of a creeper.
Definition Creeper.hpp:20
double explodeRadiusSquare
Definition Creeper.hpp:21
Represents a generic unit in the simulation.
Definition Unit.hpp:63
Configuration parameters shared among multiple units.
Definition Unit.hpp:12
Represents a 2D point with x and y coordinates.
Definition utils.hpp:10