BWAPI::Forceset class

A container that holds a group of Forces.

Contents

Base classes

template<class T, typename Compare = std::less<>>
class SetContainer<BWAPI::Force, 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 getPlayers() const -> Playerset
Retrieves the set of players that belong to this Force.

Function documentation

Playerset BWAPI::Forceset::getPlayers() const

Retrieves the set of players that belong to this Force.

Returns A Playerset object containing the players that are part of this Force.

Example usage:

// Get the enemy force, but make sure we have an enemy
BWAPI::Force enemyForce = game.enemy() ? game.enemy().getForce() : nullptr;
if ( enemyForce )
{
  Broodwar << "Those on the enemy force are..." << std::endl;
  for ( BWAPI::Player enemy : enemyForce )
    Broodwar << "  - " << enemy.getName() << std::endl;
}