BWAPI  4.2.0
An API for interacting with Starcraft: Broodwar (1.16.1)
Public Member Functions | List of all members
BWAPI::UnaryFilter< PType, Container > Class Template Reference

Public Member Functions

template<typename T >
 UnaryFilter (const T &predicate)
bool isValid () const
UnaryFilter< PType, std::function< bool(PType)> > operator! () const
template<typename T >
UnaryFilter< PType, std::function< bool(PType)> > operator&& (const T &other) const
bool operator() (PType v) const
template<typename T >
UnaryFilter< PType, std::function< bool(PType)> > operator|| (const T &other) const

Detailed Description

template<class PType, class Container = std::function<bool(PType)>>
class BWAPI::UnaryFilter< PType, Container >

UnaryFilter allows for logical functor combinations.

Unit myUnit;
// The following two if statements are equivalent
if ( myUnit->getType().isWorker() && myUnit->isCompleted() && myUnit->isIdle() )
{}
if ( (IsWorker && IsCompleted && IsIdle)(myUnit) )
{}
Template Parameters
PTypeThe type being passed into the predicate, which will be of type bool(PType).
Container(optional) Storage container for the function predicate. It is std::function<bool(PType)> by default.

Constructor & Destructor Documentation

BWAPI::UnaryFilter< PType, Container >::UnaryFilter (const T & predicate)

Member Function Documentation

UnaryFilter<PType,std::function<bool(PType)> > BWAPI::UnaryFilter< PType, Container >::operator&& (const T & other) const
UnaryFilter<PType,std::function<bool(PType)> > BWAPI::UnaryFilter< PType, Container >::operator|| (const T & other) const
UnaryFilter<PType,std::function<bool(PType)> > BWAPI::UnaryFilter< PType, Container >::operator! () const
bool BWAPI::UnaryFilter< PType, Container >::operator() (PType v) const
bool BWAPI::UnaryFilter< PType, Container >::isValid () const