BWAPI  4.4.0
An API for interacting with Starcraft: Broodwar (1.16.1)
Public Member Functions | List of all members
BWAPI::Forceset Class Reference
Inheritance diagram for BWAPI::Forceset:
Inheritance graph

Public Member Functions

Playerset getPlayers () const
- Public Member Functions inherited from std::unordered_set< K >
T unordered_set (T...args)
T begin (T...args)
T begin(int) (T...args)
T bucket (T...args)
T bucket_count (T...args)
T bucket_size (T...args)
T cbegin (T...args)
T cbegin(int) (T...args)
T cend (T...args)
T cend(int) (T...args)
T clear (T...args)
T count (T...args)
T emplace (T...args)
T emplace_hint (T...args)
T empty (T...args)
T end (T...args)
T end(int) (T...args)
T equal_range (T...args)
T erase (T...args)
T find (T...args)
T get_allocator (T...args)
T hash_function (T...args)
T insert (T...args)
T key_eq (T...args)
T load_factor (T...args)
T max_bucket_count (T...args)
T max_load_factor (T...args)
T max_size (T...args)
T operator= (T...args)
T rehash (T...args)
T reserve (T...args)
T size (T...args)
T swap (T...args)

Additional Inherited Members

- Public Attributes inherited from std::unordered_set< K >
K keys

Detailed Description

A container that holds a group of Forces.

See also
BWAPI::Force

Member 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 myEnemyForce = BWAPI::Broodwar->enemy() ? BWAPI::Broodwar->enemy()->getForce() : nullptr;
if ( myEnemyForce != nullptr )
{
Broodwar << "The allies of my enemy are..." << std::endl;
for ( auto i = myEnemyForce.begin(); i != myEnemyForce.end(); ++i )
Broodwar << " - " << i->getName() << std::endl;
}