BWAPI  4.1.2
An API for interacting with Starcraft: Broodwar (1.16.1)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules
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

template<class PType , class Container = std::function<bool(PType)>>
template<typename T >
BWAPI::UnaryFilter< PType, Container >::UnaryFilter ( const T &  predicate)

Member Function Documentation

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