BWAPI::Regionset class

A container that holds a set of Region objects.

Contents

Base classes

template<class T, typename Compare = std::less<>>
class SetContainer<BWAPI::Region, IDCompare>
This container is used to wrap convenience functions for BWAPI and be used as a bridge with a built-in set type.

Public functions

auto getCenter() const -> Position
Retrieves the center of the region.
auto getUnits(const UnitFilter& pred = nullptr) const -> Unitset
Retrieves a Unitset containing all the units that are in this region.

Function documentation

Position BWAPI::Regionset::getCenter() const

Retrieves the center of the region.

Returns A Position indicating the center location of the Region, in pixels.

This position is used as the node of the region.

Unitset BWAPI::Regionset::getUnits(const UnitFilter& pred = nullptr) const

Retrieves a Unitset containing all the units that are in this region.

Parameters
pred (optional) If this parameter is used, it is a UnitFilter or function predicate that will retrieve only the units whose attributes match the given criteria. If omitted, then a default value of nullptr is used, in which case there is no filter.
Returns A Unitset containing all units in this region that have met the requirements of pred.

Also has the ability to filter the units before the creation of the Unitset.