You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
378 B
22 lines
378 B
|
5 years ago
|
#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
|