AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
RectangleBoundary Class Reference

#include "AreaBoundary.h"

Inheritance diagram for RectangleBoundary:
AreaBoundary

Public Member Functions

 RectangleBoundary (float southX, float northX, float eastY, float westY, bool isInverted=false)
 
- Public Member Functions inherited from AreaBoundary
bool IsWithinBoundary (Position const *pos) const
 
bool IsWithinBoundary (Position const &pos) const
 
virtual ~AreaBoundary ()
 

Protected Member Functions

bool IsWithinBoundaryArea (Position const *pos) const override
 
- Protected Member Functions inherited from AreaBoundary
 AreaBoundary (bool isInverted)
 
virtual bool IsWithinBoundaryArea (Position const *pos) const =0
 

Private Attributes

float const _minX
 
float const _maxX
 
float const _minY
 
float const _maxY
 

Detailed Description

Constructor & Destructor Documentation

◆ RectangleBoundary()

RectangleBoundary::RectangleBoundary ( float  southX,
float  northX,
float  eastY,
float  westY,
bool  isInverted = false 
)
22 :
23 AreaBoundary(isInverted), _minX(southX), _maxX(northX), _minY(eastY), _maxY(westY) { }
Definition: AreaBoundary.h:24
float const _maxX
Definition: AreaBoundary.h:85
float const _minX
Definition: AreaBoundary.h:85
float const _maxY
Definition: AreaBoundary.h:85
float const _minY
Definition: AreaBoundary.h:85

Member Function Documentation

◆ IsWithinBoundaryArea()

bool RectangleBoundary::IsWithinBoundaryArea ( Position const *  pos) const
overrideprotectedvirtual

Implements AreaBoundary.

25{
26 return !(
27 pos->GetPositionX() < _minX ||
28 pos->GetPositionX() > _maxX ||
29 pos->GetPositionY() < _minY ||
30 pos->GetPositionY() > _maxY
31 );
32}

References _maxX, _maxY, _minX, _minY, Position::GetPositionX(), and Position::GetPositionY().

Member Data Documentation

◆ _maxX

float const RectangleBoundary::_maxX
private

Referenced by IsWithinBoundaryArea().

◆ _maxY

float const RectangleBoundary::_maxY
private

Referenced by IsWithinBoundaryArea().

◆ _minX

float const RectangleBoundary::_minX
private

Referenced by IsWithinBoundaryArea().

◆ _minY

float const RectangleBoundary::_minY
private

Referenced by IsWithinBoundaryArea().