Horizon Official Technical Documentation
RangeCheckPredicate Class Reference

#include <GridNotifierPredicates.hpp>

Public Member Functions

 RangeCheckPredicate (std::weak_ptr< Horizon::Zone::Unit > source)
 
bool operator() (std::weak_ptr< Horizon::Zone::Unit > target, uint16_t range=MAX_VIEW_RANGE)
 

Private Attributes

std::weak_ptr< Horizon::Zone::Unit_source
 

Constructor & Destructor Documentation

◆ RangeCheckPredicate()

RangeCheckPredicate::RangeCheckPredicate ( std::weak_ptr< Horizon::Zone::Unit source)
inline
54 : _source(source){ }
std::weak_ptr< Horizon::Zone::Unit > _source
Definition: GridNotifierPredicates.hpp:62

Member Function Documentation

◆ operator()()

bool RangeCheckPredicate::operator() ( std::weak_ptr< Horizon::Zone::Unit target,
uint16_t  range = MAX_VIEW_RANGE 
)
inline
57 {
58 return !_source.expired() && !target.expired() && _source.lock()->is_in_range_of(target.lock(), range);
59 }

References _source.

Member Data Documentation

◆ _source

std::weak_ptr<Horizon::Zone::Unit> RangeCheckPredicate::_source
private

Referenced by operator()().


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