We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks to @SonkoMagnus for mentioning the lack of BWAPI C++'s UnitFilter equivalent in BWAPI4J. Example:
UnitFilter
Unit supplyBuilder = u->getClosestUnit(GetType == supplyProviderType.whatBuilds().first && (IsIdle || IsGatheringMinerals) && IsOwned);
where getClosestUnit is declared as:
getClosestUnit
Unit UnitInterface::getClosestUnit(const UnitFilter &pred, int radius) const
As per @SonkoMagnus's suggestion, we could use Predicate as the equivalent.
Predicate
The text was updated successfully, but these errors were encountered:
Another option would be Stream style:
Unit supplyBuilder = u.unitsSortedByDistance() .filter(u -> u.isIdle() || u.isGatheringMinerals) .first()
Where unitsSortedByDistance could also take a maxRadius parameter.
unitsSortedByDistance
Sorry, something went wrong.
No branches or pull requests
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:As per @SonkoMagnus's suggestion, we could use
Predicate
as the equivalent.The text was updated successfully, but these errors were encountered: