Thanks to @SonkoMagnus for mentioning the lack of BWAPI C++'s UnitFilter equivalent in BWAPI4J. Example:
Unit supplyBuilder =
u->getClosestUnit(GetType == supplyProviderType.whatBuilds().first
&& (IsIdle || IsGatheringMinerals)
&& IsOwned);
where getClosestUnit is declared as:
Unit UnitInterface::getClosestUnit(const UnitFilter &pred, int radius) const
As per @SonkoMagnus's suggestion, we could use Predicate as the equivalent.
Thanks to @SonkoMagnus for mentioning the lack of BWAPI C++'s
UnitFilterequivalent in BWAPI4J. Example:Unit supplyBuilder = u->getClosestUnit(GetType == supplyProviderType.whatBuilds().first && (IsIdle || IsGatheringMinerals) && IsOwned);where
getClosestUnitis declared as:As per @SonkoMagnus's suggestion, we could use
Predicateas the equivalent.