BWAPI 4.2.0 An API for interacting with Starcraft: Broodwar (1.16.1) |
Public Types | |
typedef std::deque< T > | list |
typedef SetContainer< T > | set |
Public Member Functions | |
constexpr | Type (int id) |
const char * | c_str () const |
constexpr int | getID () const |
const std::string & | getName () const |
constexpr bool | isValid () const |
constexpr | operator int () const |
const std::string & | toString () const |
Static Public Member Functions | |
static T | getType (std::string name) |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Type< T, UnknownId > &t) |
std::wostream & | operator<< (std::wostream &os, const Type< T, UnknownId > &t) |
Base superclass for all BWAPI Types.
T | The type class that this Type is representing. |
UnknownId | The enum ID of the unknown entry, which is also treated as the last entry for type validity. |
A set type that contains the current type.
A list type that contains the current type.
Expected type constructor.
If the type is an invalid type, then it becomes Types::Unknown. A type is invalid if its value is less than 0 or greater than Types::Unknown.
id | The id that corresponds to this type. It is typically an integer value that corresponds to an internal Broodwar type. If the given id is invalid, then it becomes Types::Unknown. |
Conversion/convenience operator to convert this type to its primitive type.
Retrieves this type's identifier as an integer.
Checks if the current type has a valid identifier.
The purpose of this function is to prevent buffer overflows if a type has been handled improperly.
A type is valid if it is between 0 and Unknown (inclusive).
Referenced by BWAPI::Type< T, UnknownId >::getName().
Retrieves the variable name of the type.
References BWAPI::Type< T, UnknownId >::isValid().
Referenced by BWAPI::Type< T, UnknownId >::c_str(), and BWAPI::Type< T, UnknownId >::toString().
Retrieves the variable name of the type.
References BWAPI::Type< T, UnknownId >::getName().
Retrieves the variable name of the type as a c-style string.
Meant to be a convenience member.
References std::string::c_str(), and BWAPI::Type< T, UnknownId >::getName().
Searches for the type associated with the given string and returns it.
name | A string containing the name of the type. |
References std::string::begin(), std::string::end(), std::string::erase(), std::remove_if(), std::tolower(), and std::transform().
Output stream operator overload.
Allows printing of the type without calling Type::getName.
os | The destination output stream. |
t | The type to write as a string. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.