raven/src/Box.hpp

45 lines
1 KiB
C++
Raw Normal View History

2022-03-08 02:25:22 +02:00
#pragma once
2022-03-18 02:49:16 +02:00
#include "Point.hpp"
2022-03-08 02:25:22 +02:00
namespace Raven {
class Box {
private:
double m_x {0};
double m_y {0};
double m_width {0};
double m_height {0};
public:
Box() {}
Box(double x, double y, double width, double height)
: m_x(x)
, m_y(y)
, m_width(width)
, m_height(height)
{
}
double get_x() { return m_x; }
double get_y() { return m_y; }
double get_width() { return m_width; }
double get_height() { return m_height; }
2022-03-18 03:24:02 +02:00
double get_x() const { return m_x; }
double get_y() const { return m_y; }
double get_width() const { return m_width; }
double get_height() const { return m_height; }
2022-03-08 02:25:22 +02:00
void set_x(double x) { m_x = x; }
void set_y(double y) { m_y = y; }
void set_width(double width) { m_width = width; }
void set_height(double height) { m_height = height; }
2022-03-18 03:24:02 +02:00
bool contains_point(double x, double y) const;
bool contains_point(const Point &point) const;
bool contains_box(const Box &other) const;
2022-03-08 02:25:22 +02:00
};
}