Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-06-03 23:16:28 +08:00
40 changed files with 555 additions and 243 deletions

View File

@@ -110,3 +110,21 @@ bool BoundaryUnionBoundary::IsWithinBoundaryArea(Position const* pos) const
{
return (_b1->IsWithinBoundary(pos) || _b2->IsWithinBoundary(pos));
}
// ---== INTERSECT OF 2 BOUNDARIES ==---
BoundaryIntersectBoundary::BoundaryIntersectBoundary(AreaBoundary const* b1, AreaBoundary const* b2, bool isInverted) :
AreaBoundary(isInverted), _b1(b1), _b2(b2)
{
ASSERT(b1 && b2);
}
BoundaryIntersectBoundary::~BoundaryIntersectBoundary()
{
delete _b1;
delete _b2;
}
bool BoundaryIntersectBoundary::IsWithinBoundaryArea(Position const* pos) const
{
return (_b1->IsWithinBoundary(pos) && _b2->IsWithinBoundary(pos));
}

View File

@@ -165,4 +165,18 @@ class AC_GAME_API BoundaryUnionBoundary : public AreaBoundary
AreaBoundary const* const _b2;
};
class AC_GAME_API BoundaryIntersectBoundary : public AreaBoundary
{
public:
BoundaryIntersectBoundary(AreaBoundary const* b1, AreaBoundary const* b2, bool isInverted = false);
protected:
virtual ~BoundaryIntersectBoundary();
bool IsWithinBoundaryArea(Position const* pos) const override;
private:
AreaBoundary const* const _b1;
AreaBoundary const* const _b2;
};
#endif //ACORE_AREA_BOUNDARY_H