mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Maps: Implemented BoundaryIntersectionBoundary
This commit is contained in:
@@ -105,3 +105,21 @@ bool BoundaryUnionBoundary::IsWithinBoundaryArea(Position const* pos) const
|
||||
{
|
||||
return (_b1->IsWithinBoundary(pos) || _b2->IsWithinBoundary(pos));
|
||||
}
|
||||
|
||||
// ---== INTERSECTION OF 2 BOUNDARIES ==---
|
||||
BoundaryIntersectionBoundary::BoundaryIntersectionBoundary(AreaBoundary const* b1, AreaBoundary const* b2, bool isInverted) :
|
||||
AreaBoundary(isInverted), _b1(b1), _b2(b2)
|
||||
{
|
||||
ASSERT(b1 && b2);
|
||||
}
|
||||
|
||||
BoundaryIntersectionBoundary::~BoundaryIntersectionBoundary()
|
||||
{
|
||||
delete _b1;
|
||||
delete _b2;
|
||||
}
|
||||
|
||||
bool BoundaryIntersectionBoundary::IsWithinBoundaryArea(Position const* pos) const
|
||||
{
|
||||
return (_b1->IsWithinBoundary(pos) && _b2->IsWithinBoundary(pos));
|
||||
}
|
||||
|
||||
@@ -164,4 +164,18 @@ class TC_GAME_API BoundaryUnionBoundary : public AreaBoundary
|
||||
AreaBoundary const* const _b2;
|
||||
};
|
||||
|
||||
class TC_GAME_API BoundaryIntersectionBoundary : public AreaBoundary
|
||||
{
|
||||
public:
|
||||
BoundaryIntersectionBoundary(AreaBoundary const* b1, AreaBoundary const* b2, bool isInverted = false);
|
||||
|
||||
protected:
|
||||
virtual ~BoundaryIntersectionBoundary();
|
||||
bool IsWithinBoundaryArea(Position const* pos) const override;
|
||||
|
||||
private:
|
||||
AreaBoundary const* const _b1;
|
||||
AreaBoundary const* const _b2;
|
||||
};
|
||||
|
||||
#endif //TRINITY_AREA_BOUNDARY_H
|
||||
|
||||
Reference in New Issue
Block a user