15 std::list<Rectangle> bedrocks_;
17 std::function<double(
Point p1,
Point p2)> distanceFunc;
26 [[nodiscard]]
static std::optional<Point> checkIntersection(
Point unitsOldCoord,
Point unitsNewCoord,
Point corner1,
33 [[nodiscard]] std::vector<Point> getCorners(
Rectangle bedrock)
const;
65 : bounds_(bounds), distanceFunc(distanceFunc) {};
A class for managing game field parameters.
Definition FieldParams.hpp:14
std::optional< Point > checkIntersections(Point unitsOldCoord, Point unitsNewCoord) const
Checks for intersections of an object's trajectory with any obstacle on the field.
Definition FieldParams.cpp:42
auto & getDistanceFunc()
Retrieves the distance calculation function.
Definition FieldParams.hpp:40
void setBedrock(const Rectangle &bedrock)
Adds a new obstacle to the field.
Definition FieldParams.hpp:70
FieldParams(const Rectangle &bounds, const std::function< double(Point p1, Point p2)> &distanceFunc)
Constructor for the FieldParams class.
Definition FieldParams.hpp:64
bool checkInsideBlock(Point coord) const
Checks if a point is inside an obstacle.
Definition FieldParams.cpp:58
auto & getBounds()
Retrieves the field boundaries.
Definition FieldParams.hpp:45
void deleteBedrock(const Rectangle &bedrock)
Definition FieldParams.hpp:72
Represents a 2D point with x and y coordinates.
Definition utils.hpp:10
Represents a rectangle defined by two points: bottom-left and top-right.
Definition utils.hpp:24