21 lines
378 B
C++
21 lines
378 B
C++
#pragma once
|
|
|
|
#include "engine/displacement.hpp"
|
|
#include "engine/point.hpp"
|
|
|
|
namespace devilution {
|
|
|
|
struct Circle {
|
|
Point position;
|
|
int radius;
|
|
|
|
constexpr bool Contains(Point point) const
|
|
{
|
|
Displacement diff = point - position;
|
|
int x = diff.deltaX;
|
|
int y = diff.deltaY;
|
|
return x * x + y * y < radius * radius;
|
|
}
|
|
};
|
|
|
|
} // namespace devilution
|