Files
ephphatha c68fcf3cb1 Apply MethodCase config to Rectangle::Contains
Also included Circle and VirtualButton classes due to the shared use.
2022-06-24 00:39:55 +02:00

22 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