TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
RectangleBoundary Class Reference

#include <AreaBoundary.h>

Public Member Functions

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

Protected Member Functions

bool IsWithinBoundaryArea (const Position *pos) const override
 
- Protected Member Functions inherited from AreaBoundary
 AreaBoundary (BoundaryType bType, bool isInverted)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from AreaBoundary
enum  BoundaryType {
  BOUNDARY_RECTANGLE, BOUNDARY_CIRCLE, BOUNDARY_ELLIPSE, BOUNDARY_TRIANGLE,
  BOUNDARY_PARALLELOGRAM, BOUNDARY_Z_RANGE
}
 
- Protected Attributes inherited from AreaBoundary
const BoundaryType m_boundaryType
 
bool m_isInvertedBoundary
 

Constructor & Destructor Documentation

RectangleBoundary::RectangleBoundary ( float  southX,
float  northX,
float  eastY,
float  westY,
bool  isInverted = false 
)
23  :
24  AreaBoundary(BoundaryType::BOUNDARY_RECTANGLE, isInverted), _minX(southX), _maxX(northX), _minY(eastY), _maxY(westY) { }
const float _minX
Definition: AreaBoundary.h:79
const float _maxX
Definition: AreaBoundary.h:79
const float _minY
Definition: AreaBoundary.h:79
const float _maxY
Definition: AreaBoundary.h:79
AreaBoundary(BoundaryType bType, bool isInverted)
Definition: AreaBoundary.h:63

Member Function Documentation

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

Implements AreaBoundary.

26 {
27  if (!pos)
28  return false;
29 
30  return !(
31  pos->GetPositionX() < _minX ||
32  pos->GetPositionX() > _maxX ||
33  pos->GetPositionY() < _minY ||
34  pos->GetPositionY() > _maxY
35  );
36 }
float GetPositionY() const
Definition: Position.h:105
const float _minX
Definition: AreaBoundary.h:79
float GetPositionX() const
Definition: Position.h:104
const float _maxX
Definition: AreaBoundary.h:79
const float _minY
Definition: AreaBoundary.h:79
const float _maxY
Definition: AreaBoundary.h:79

+ Here is the call graph for this function:

Member Data Documentation

const float RectangleBoundary::_maxX
private
const float RectangleBoundary::_maxY
private
const float RectangleBoundary::_minX
private
const float RectangleBoundary::_minY
private

The documentation for this class was generated from the following files: