BWAPI  4.1.2
An API for interacting with Starcraft: Broodwar (1.16.1)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules
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 >
unordered_set (T...args)
 
begin (T...args)
 
begin(int) (T...args)
 
bucket (T...args)
 
bucket_count (T...args)
 
bucket_size (T...args)
 
cbegin (T...args)
 
cbegin(int) (T...args)
 
cend (T...args)
 
cend(int) (T...args)
 
clear (T...args)
 
count (T...args)
 
emplace (T...args)
 
emplace_hint (T...args)
 
empty (T...args)
 
end (T...args)
 
end(int) (T...args)
 
equal_range (T...args)
 
erase (T...args)
 
find (T...args)
 
get_allocator (T...args)
 
hash_function (T...args)
 
insert (T...args)
 
key_eq (T...args)
 
load_factor (T...args)
 
max_bucket_count (T...args)
 
max_load_factor (T...args)
 
max_size (T...args)
 
operator= (T...args)
 
rehash (T...args)
 
reserve (T...args)
 
size (T...args)
 
swap (T...args)
 

Additional Inherited Members

- Public Attributes inherited from std::unordered_set< 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;
}