-
Notifications
You must be signed in to change notification settings - Fork 1
/
class_b_w_a_p_i_1_1_player_interface.html
1 lines (1 loc) · 83.9 KB
/
class_b_w_a_p_i_1_1_player_interface.html
1
<!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>BWAPI: BWAPI::PlayerInterface Class Reference</title><link rel="shortcut icon" href="favicon.ico" type="image/x-icon"><link rel="icon" href="favicon.ico" type="image/x-icon"><script>if(window.location.protocol!="file:"){(function(d,e,j,h,f,c,b){d.GoogleAnalyticsObject=f;d[f]=d[f]||function(){(d[f].q=d[f].q||[]).push(arguments)},d[f].l=1*new Date();c=e.createElement(j),b=e.getElementsByTagName(j)[0];c.async=1;c.src=h;b.parentNode.insertBefore(c,b)})(window,document,"script","//www.google-analytics.com/analytics.js","ga");ga("create","UA-11415685-4","auto");ga("send","pageview")};</script><link href="doxygen.css" rel="stylesheet"><script src="search/search.js"></script></head><body><div id="top"><div id="titlearea"><table><tbody><tr style="height: 56px;"><td id="projectlogo"><img style="width:110px;height:55px;" alt="Logo" src="logo.png"></td><td style="padding-left: 0.5em;"><div id="projectname">BWAPI <span id="projectnumber">4.2.0</span></div><div id="projectbrief">An API for interacting with Starcraft: Broodwar (1.16.1)</div></td></tr></tbody></table><div class="ribbon"><a href="//github.com/bwapi/bwapi">Fork me on GitHub</a></div></div><script>var searchBox=new SearchBox("searchBox","search",false,"Search");</script><div id="navrow1" class="tabs"><ul class="tablist"><li><a href="index.html"><span>Main Page</span></a></li><li><a href="modules.html"><span>Modules</span></a></li><li><a href="namespaces.html"><span>Namespaces</span></a></li><li class="current"><a href="annotated.html"><span>Classes</span></a></li><li><a href="//github.com/bwapi/bwapi/issues"><span>Issues</span></a></li><li><a href="//github.com/bwapi/bwapi/wiki"><span>Wiki</span></a></li><li><div id="MSearchBox" class="MSearchBoxInactive"><span class="left"><img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""><input id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"></span><span class="right"><a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" src="search/close.png" alt=""></a></span></div></li></ul></div><div id="navrow2" class="tabs2"><ul class="tablist"><li><a href="annotated.html"><span>Class List</span></a></li><li><a href="classes.html"><span>Class Index</span></a></li><li><a href="inherits.html"><span>Class Hierarchy</span></a></li><li><a href="functions.html"><span>Class Members</span></a></li></ul></div><div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"></div><div id="MSearchResultsWindow"><iframe src="javascript:void(0)" name="MSearchResults" id="MSearchResults"></iframe></div><div id="nav-path" class="navpath"><ul><li class="navelem"><a class="el" href="namespace_b_w_a_p_i.html">BWAPI</a></li><li class="navelem"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html">PlayerInterface</a></li></ul></div></div><div class="header"><div class="summary"><a href="#pub-methods">Public Member Functions</a> | <a href="class_b_w_a_p_i_1_1_player_interface-members.html">List of all members</a></div><div class="headertitle"><div class="title">BWAPI::PlayerInterface Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="group___interface.html">Interface Classes</a></div></div></div></div><div class="contents"><div class="dynheader"> Inheritance diagram for BWAPI::PlayerInterface:</div><div class="dyncontent"><div class="center"><img src="class_b_w_a_p_i_1_1_player_interface__inherit__graph.png" usemap="#_b_w_a_p_i_1_1_player_interface_inherit__map" alt="Inheritance graph"></div><map name="_b_w_a_p_i_1_1_player_interface_inherit__map" id="_b_w_a_p_i_1_1_player_interface_inherit__map"><area shape="rect" id="node3" href="class_b_w_a_p_i_1_1_interface.html" title="This generalized class allows the application of features that are common to all interface classes..." alt="" coords="14,5,169,33"></map></div><table class="memberdecls"><tbody><tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods"></a> Public Member Functions</h2></td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a74dc2dc96ea64c6fcef392107d39ee9e">allUnitCount</a> (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> unit=<a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869">UnitTypes::AllUnits</a>) const =0</td></tr><tr><td class="memItemLeft">int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a68ee4e16151133896b5292c122221cd9">armor</a> (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> unit) const </td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#acb8623f9a962eb6811faa458eb0aae03">completedUnitCount</a> (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> unit=<a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869">UnitTypes::AllUnits</a>) const =0</td></tr><tr><td class="memItemLeft">int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a5c601001f65b2d7db66bf175e81f939a">damage</a> (<a class="el" href="class_b_w_a_p_i_1_1_weapon_type.html">WeaponType</a> wpn) const </td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a3cad0d29d13fd2acfffb53f8c38db8b9">deadUnitCount</a> (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> unit=<a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869">UnitTypes::AllUnits</a>) const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#ae5f699ef20e5e12f1e744cc98c56e860">gas</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a403e086136c7ff3538b8708649157d1a">gatheredGas</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a709df7d0fe07f4caf6e18d61f3b7b9e9">gatheredMinerals</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a5d89e6dbc9e4d9e6dc0d17488a6314a6">getBuildingScore</a> () const =0</td></tr><tr><td class="memItemLeft">virtual <a class="el" href="class_b_w_a_p_i_1_1_color.html">BWAPI::Color</a> </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#aaab8fe611281b5d8f1c1c1193846b02c">getColor</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a6c78736629b8f07b76e263ae40ae016c">getCustomScore</a> () const =0</td></tr><tr><td class="memItemLeft">virtual <a class="el" href="namespace_b_w_a_p_i.html#af85e7ce6d3bc826da6660d97443fa65e">Force</a> </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#af80b0867a98310cc3b7ab6b39f54f7e2">getForce</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a79776e604f18cfd6581e28af1b98cc09">getID</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a2362c952155c160e4dcd02c9cf2c87c5">getKillScore</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a21655d8959f93d8bdfcf192ca9c9d162">getMaxUpgradeLevel</a> (<a class="el" href="class_b_w_a_p_i_1_1_upgrade_type.html">UpgradeType</a> upgrade) const =0</td></tr><tr><td class="memItemLeft">virtual <a class="elRef" href="//en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a03a56101c977db1336ab2b3fa8d76bef">getName</a> () const =0</td></tr><tr><td class="memItemLeft">virtual <a class="el" href="class_b_w_a_p_i_1_1_race.html">Race</a> </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a169afa32d319a4f065a8d7aa56fac052">getRace</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a7451a3a7882ab96b3b3a83becc734e6e">getRazingScore</a> () const =0</td></tr><tr><td class="memItemLeft">virtual <a class="el" href="namespace_b_w_a_p_i.html#af10e9d3456f11a2d2969ace281a9961f">TilePosition</a> </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a10406581d9c94622084313d1abe47976">getStartLocation</a> () const =0</td></tr><tr><td class="memItemLeft">char </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a931e38f57cddbd9a01e9d05bb1d31c5a">getTextColor</a> () const </td></tr><tr><td class="memItemLeft">virtual <a class="el" href="class_b_w_a_p_i_1_1_player_type.html">PlayerType</a> </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#af6e318ba02bede12592229af33314767">getType</a> () const =0</td></tr><tr><td class="memItemLeft">virtual const <a class="el" href="class_b_w_a_p_i_1_1_unitset.html">Unitset</a> & </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a1c92c70f4ea48fa58f23351d6bb5d3ae">getUnits</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a7cbf6db84723ab8f9432fbb80ea6b4fa">getUnitScore</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a4868817cb4c9bb9365a1a854b489c603">getUpgradeLevel</a> (<a class="el" href="class_b_w_a_p_i_1_1_upgrade_type.html">UpgradeType</a> upgrade) const =0</td></tr><tr><td class="memItemLeft">virtual bool </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a96cd44cd47fac999044d90b0f9fc8bee">hasResearched</a> (<a class="el" href="class_b_w_a_p_i_1_1_tech_type.html">TechType</a> tech) const =0</td></tr><tr><td class="memItemLeft">bool </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#af1bbbc518426ad4119f52549548a8c91">hasUnitTypeRequirement</a> (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> unit, int amount=1) const </td></tr><tr><td class="memItemLeft">int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a03c0ccd4319cdcbf4b83a8af2ee94ef5">incompleteUnitCount</a> (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> unit=<a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869">UnitTypes::AllUnits</a>) const </td></tr><tr><td class="memItemLeft">virtual bool </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a3db59dd8a7c4b1fbcad68f1cb9bb79ae">isAlly</a> (const <a class="el" href="namespace_b_w_a_p_i.html#ab8daa67d10dc7eaa154a2636ec1784f8">Player</a> player) const =0</td></tr><tr><td class="memItemLeft">virtual bool </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#adc156dce21066e82dc83d9ad3612354a">isDefeated</a> () const =0</td></tr><tr><td class="memItemLeft">virtual bool </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a47be0b34e19c607b4dba314a3e3e57db">isEnemy</a> (const <a class="el" href="namespace_b_w_a_p_i.html#ab8daa67d10dc7eaa154a2636ec1784f8">Player</a> player) const =0</td></tr><tr><td class="memItemLeft">virtual bool </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#ab5801e189fa93a35ab55dd05dbd640ad">isNeutral</a> () const =0</td></tr><tr><td class="memItemLeft">virtual bool </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#ae5e9f15c8c870486362117d24e906c55">isObserver</a> () const =0</td></tr><tr><td class="memItemLeft">virtual bool </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#ae6acf0903f79ab307c0a1ae8ab550d37">isResearchAvailable</a> (<a class="el" href="class_b_w_a_p_i_1_1_tech_type.html">TechType</a> tech) const =0</td></tr><tr><td class="memItemLeft">virtual bool </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a01d08fa13879186156bf941403178ca3">isResearching</a> (<a class="el" href="class_b_w_a_p_i_1_1_tech_type.html">TechType</a> tech) const =0</td></tr><tr><td class="memItemLeft">virtual bool </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a5c2eb71bb2aab487474093d1a532e848">isUnitAvailable</a> (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> unit) const =0</td></tr><tr><td class="memItemLeft">virtual bool </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#ad440e4acf496c81e3862b6c5c9ad100f">isUpgrading</a> (<a class="el" href="class_b_w_a_p_i_1_1_upgrade_type.html">UpgradeType</a> upgrade) const =0</td></tr><tr><td class="memItemLeft">virtual bool </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a10fd0989c7e367e7c9ad3fa7ae7468e3">isVictorious</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a2db792726d00d64d8415609b50f34158">killedUnitCount</a> (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> unit=<a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869">UnitTypes::AllUnits</a>) const =0</td></tr><tr><td class="memItemLeft">virtual bool </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#ad8eff70dd2068f6139461efb87acdacc">leftGame</a> () const =0</td></tr><tr><td class="memItemLeft">int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a2bac79e0c02b668b4bb1b62c3487d55a">maxEnergy</a> (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> unit) const </td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#acd1991823cf6aa521bd59c6c06766017">minerals</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a372835195c5b4912208f7cff98f8a480">refundedGas</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#ad09061d23a6bfcc50851e1ad2de7217c">refundedMinerals</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#acf2f75a71093e35ed22a751ab4928800">repairedGas</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#ab05ae3c3aa1f2efdee9a8fee2e2f0010">repairedMinerals</a> () const =0</td></tr><tr><td class="memItemLeft">int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#ab7a8f3a71aa9d8263c57624043c6e630">sightRange</a> (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> unit) const </td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a65475ddb888ae451a92dc2314fb1bf01">spentGas</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a55dbc168a56c8f2aeb5495d6ba8e4270">spentMinerals</a> () const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a1fe1b56eb1fe1c9079ae410ad3dacc6e">supplyTotal</a> (<a class="el" href="class_b_w_a_p_i_1_1_race.html">Race</a> race=<a class="el" href="namespace_b_w_a_p_i_1_1_races.html#ab6642f18c4a1bf2f081a991d15b01424">Races::None</a>) const =0</td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a3cda00eeda2b8edc1d015dac4f038bdb">supplyUsed</a> (<a class="el" href="class_b_w_a_p_i_1_1_race.html">Race</a> race=<a class="el" href="namespace_b_w_a_p_i_1_1_races.html#ab6642f18c4a1bf2f081a991d15b01424">Races::None</a>) const =0</td></tr><tr><td class="memItemLeft">double </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a328b39f56a6bb6cdef426dcdbde4e533">topSpeed</a> (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> unit) const </td></tr><tr><td class="memItemLeft">virtual int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a7900c982aa8ccf52c36905f0a523140e">visibleUnitCount</a> (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> unit=<a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869">UnitTypes::AllUnits</a>) const =0</td></tr><tr><td class="memItemLeft">int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a201505286ef56cbbe540f05f76e50624">weaponDamageCooldown</a> (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> unit) const </td></tr><tr><td class="memItemLeft">int </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a81ed329622222bfd53dc1088dba32642">weaponMaxRange</a> (<a class="el" href="class_b_w_a_p_i_1_1_weapon_type.html">WeaponType</a> weapon) const </td></tr></tbody></table><a id="details"></a><h2 class="groupheader">Detailed Description</h2><div class="textblock"><p>The Player represents a unique controller in the game. </p><p>Each player in a match will have his or her own player instance. There is also a neutral player which owns all the neutral units (such as mineral patches and vespene geysers).</p><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_playerset.html" title="A set containing Player objects.">Playerset</a>, <a class="el" href="class_b_w_a_p_i_1_1_player_type.html" title="Represents the type of controller for the player slot (i.e. ">PlayerType</a>, <a class="el" href="class_b_w_a_p_i_1_1_race.html" title="The Race object is used to get information about a particular race. ">Race</a></dd></dl></div><h2 class="groupheader">Member Function Documentation</h2><a class="anchor" id="a79776e604f18cfd6581e28af1b98cc09"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::getID () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves a unique ID that represents the player. </p><dl class="section return"><dt>Returns</dt><dd>An integer representing the ID of the player. </dd></dl></div></div><a class="anchor" id="a03a56101c977db1336ab2b3fa8d76bef"></a><div class="memitem"><div class="memproto">virtual <a class="elRef" href="//en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> BWAPI::PlayerInterface::getName () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the name of the player. </p><dl class="section return"><dt>Returns</dt><dd>A <a class="elRef" href="//en.cppreference.com/w/cpp/string/basic_string.html" title="STL class. ">std::string</a> object containing the player's name.</dd></dl><dl class="section note"><dt>Note</dt><dd>Don't forget to use <a class="elRef" href="//en.cppreference.com/w/cpp/string/basic_string/c_str.html">std::string::c_str()</a> when passing this parameter to <a class="el" href="class_b_w_a_p_i_1_1_game.html#a1c962ad68ec74004b20e76d7cd3723f7" title="Sends a text message to all other players in the game. ">Game::sendText</a> and other variadic functions.</dd></dl><p>Example usage: </p><div class="fragment"><div class="line"><a class="code" href="class_b_w_a_p_i_1_1_player_interface.html">BWAPI::Player</a> myEnemy = <a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a>->enemy();</div><div class="line"><span class="keywordflow">if</span> ( myEnemy != <span class="keyword">nullptr</span> ) <span class="comment">// Make sure there is an enemy!</span></div><div class="line"><a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a>->sendText(<span class="stringliteral">"Prepare to be crushed, %s!"</span>, myEnemy-><a class="code" href="class_b_w_a_p_i_1_1_player_interface.html#a03a56101c977db1336ab2b3fa8d76bef">getName</a>().<a class="codeRef" href="//en.cppreference.com/w/cpp/string/basic_string/c_str.html">c_str</a>());</div></div></div></div><a class="anchor" id="a1c92c70f4ea48fa58f23351d6bb5d3ae"></a><div class="memitem"><div class="memproto">virtual const <a class="el" href="class_b_w_a_p_i_1_1_unitset.html">Unitset</a>& BWAPI::PlayerInterface::getUnits () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the set of all units that the player owns. </p><p>This also includes incomplete units.</p><dl class="section return"><dt>Returns</dt><dd>Reference to a <a class="el" href="class_b_w_a_p_i_1_1_unitset.html" title="The Unitset is a container for a set of pointers to Unit objects. ">Unitset</a> containing the units.</dd></dl><dl class="section note"><dt>Note</dt><dd>This does not include units that are loaded into transports, <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#a90f861a36087ce17173d3f242718bd39">Bunkers</a>, <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#a9b26cb07722f510e26344c22b57f232b">Refineries</a>, <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#ac790ed39018dbacfb254b004ff28c928">Assimilators</a>, or <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#a45b11b3a10f55c560a41155dbef9455c">Extractors</a>.</dd></dl><p>Example usage: </p><div class="fragment"><div class="line">Unitset myUnits = <a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a>->self()->getUnits();</div><div class="line"><span class="keywordflow">for</span> ( <span class="keyword">auto</span> u = myUnits.begin(); u != myUnits.end(); ++u )</div><div class="line">{</div><div class="line"><span class="comment">// Do something with your units</span></div><div class="line">}</div></div></div></div><a class="anchor" id="a169afa32d319a4f065a8d7aa56fac052"></a><div class="memitem"><div class="memproto">virtual <a class="el" href="class_b_w_a_p_i_1_1_race.html">Race</a> BWAPI::PlayerInterface::getRace () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the race of the player. </p><p>This allows you to change strategies against different races, or generalize some commands for yourself.</p><dl class="retval"><dt>Return values</dt><dd><table class="retval"><tbody><tr><td class="paramname"><a class="el" href="namespace_b_w_a_p_i_1_1_races.html#af7493e49e097840a8a2d0d3250fa875f">Races::Unknown</a></td><td>If the player chose <a class="el" href="namespace_b_w_a_p_i_1_1_races.html#ae2f12e7be1c3ae10e40b489406f41fbe">Races::Random</a> when the game started and they have not been seen.</td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>The <a class="el" href="class_b_w_a_p_i_1_1_race.html" title="The Race object is used to get information about a particular race. ">Race</a> that the player is using.</dd></dl><p>Example usage: </p><div class="fragment"><div class="line"><span class="keywordflow">if</span> ( <a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a>->enemy() )</div><div class="line">{</div><div class="line"><a class="code" href="class_b_w_a_p_i_1_1_race.html">BWAPI::Race</a> enemyRace = <a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a>->enemy()->getRace();</div><div class="line"><span class="keywordflow">if</span> ( enemyRace == <a class="code" href="namespace_b_w_a_p_i_1_1_races.html#ad34de4d5faa0d1703a174337fc36ab97">Races::Zerg</a> )</div><div class="line"><a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a>->sendText(<span class="stringliteral">"Do you really think you can beat me with a zergling rush?"</span>);</div><div class="line">}</div></div></div></div><a class="anchor" id="af6e318ba02bede12592229af33314767"></a><div class="memitem"><div class="memproto">virtual <a class="el" href="class_b_w_a_p_i_1_1_player_type.html">PlayerType</a> BWAPI::PlayerInterface::getType () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the player's controller type. </p><p>This allows you to distinguish betweeen computer and human players.</p><dl class="section return"><dt>Returns</dt><dd>The <a class="el" href="class_b_w_a_p_i_1_1_player_type.html" title="Represents the type of controller for the player slot (i.e. ">PlayerType</a> that identifies who is controlling a player.</dd></dl><dl class="section note"><dt>Note</dt><dd>Other players using <a class="el" href="namespace_b_w_a_p_i.html" title="The primary namespace for the BWAPI interface. ">BWAPI</a> will be treated as a human player and return <a class="el" href="namespace_b_w_a_p_i_1_1_player_types.html#ad4f399b2e6cb2ff1bcf6bf0fe12eea86" title="Player. ">PlayerTypes::Player</a>.</dd></dl><div class="fragment"><div class="line"><span class="keywordflow">if</span> ( <a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a>->enemy() )</div><div class="line">{</div><div class="line"><span class="keywordflow">if</span> ( <a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a>->enemy()-><a class="code" href="class_b_w_a_p_i_1_1_player_interface.html#af6e318ba02bede12592229af33314767">getType</a>() == <a class="code" href="namespace_b_w_a_p_i_1_1_player_types.html#ac9154091c6e8e10aee9b932fd493e29c">PlayerTypes::Computer</a> )</div><div class="line"><a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a> << <span class="stringliteral">"Looks like something I can abuse!"</span> << <a class="codeRef" href="//en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div><div class="line">}</div></div></div></div><a class="anchor" id="af80b0867a98310cc3b7ab6b39f54f7e2"></a><div class="memitem"><div class="memproto">virtual <a class="el" href="namespace_b_w_a_p_i.html#af85e7ce6d3bc826da6660d97443fa65e">Force</a> BWAPI::PlayerInterface::getForce () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the player's force. </p><p>A force is the team that the player is playing on.</p><dl class="section return"><dt>Returns</dt><dd>The Force object that the player is part of. </dd></dl></div></div><a class="anchor" id="a3db59dd8a7c4b1fbcad68f1cb9bb79ae"></a><div class="memitem"><div class="memproto">virtual bool BWAPI::PlayerInterface::isAlly (const <a class="el" href="namespace_b_w_a_p_i.html#ab8daa67d10dc7eaa154a2636ec1784f8">Player</a> <span class="paramname"><em>player</em></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Checks if this player is allied to the specified player. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">player</td><td>The player to check alliance with. </td></tr></tbody></table></dd></dl><dl class="retval"><dt>Return values</dt><dd><table class="retval"><tbody><tr><td class="paramname">true</td><td>if this player is allied with <code>player</code> . </td></tr><tr><td class="paramname">false</td><td>if this player is not allied with <code>player</code>.</td></tr></tbody></table></dd></dl><dl class="section note"><dt>Note</dt><dd>This function will also return false if this player is neutral or an observer, or if <code>player</code> is neutral or an observer.</dd></dl><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a47be0b34e19c607b4dba314a3e3e57db" title="Checks if this player is unallied to the specified player. ">isEnemy</a></dd></dl></div></div><a class="anchor" id="a47be0b34e19c607b4dba314a3e3e57db"></a><div class="memitem"><div class="memproto">virtual bool BWAPI::PlayerInterface::isEnemy (const <a class="el" href="namespace_b_w_a_p_i.html#ab8daa67d10dc7eaa154a2636ec1784f8">Player</a> <span class="paramname"><em>player</em></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Checks if this player is unallied to the specified player. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">player</td><td>The player to check alliance with. </td></tr></tbody></table></dd></dl><dl class="retval"><dt>Return values</dt><dd><table class="retval"><tbody><tr><td class="paramname">true</td><td>if this player is allied with <code>player</code> . </td></tr><tr><td class="paramname">false</td><td>if this player is not allied with <code>player</code> .</td></tr></tbody></table></dd></dl><dl class="section note"><dt>Note</dt><dd>This function will also return false if this player is neutral or an observer, or if <code>player</code> is neutral or an observer.</dd></dl><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a3db59dd8a7c4b1fbcad68f1cb9bb79ae" title="Checks if this player is allied to the specified player. ">isAlly</a></dd></dl></div></div><a class="anchor" id="ab5801e189fa93a35ab55dd05dbd640ad"></a><div class="memitem"><div class="memproto">virtual bool BWAPI::PlayerInterface::isNeutral () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Checks if this player is the neutral player. </p><dl class="retval"><dt>Return values</dt><dd><table class="retval"><tbody><tr><td class="paramname">true</td><td>if this player is the neutral player. </td></tr><tr><td class="paramname">false</td><td>if this player is any other player. </td></tr></tbody></table></dd></dl></div></div><a class="anchor" id="a10406581d9c94622084313d1abe47976"></a><div class="memitem"><div class="memproto">virtual <a class="el" href="namespace_b_w_a_p_i.html#af10e9d3456f11a2d2969ace281a9961f">TilePosition</a> BWAPI::PlayerInterface::getStartLocation () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieve's the player's starting location. </p><dl class="section return"><dt>Returns</dt><dd>A TilePosition containing the position of the start location.</dd></dl><dl class="retval"><dt>Return values</dt><dd><table class="retval"><tbody><tr><td class="paramname"><a class="el" href="namespace_b_w_a_p_i_1_1_tile_positions.html#acb9dceafd1b5a020f687a81dfa02a76a">TilePositions::None</a></td><td>if the player does not have a start location. </td></tr><tr><td class="paramname"><a class="el" href="namespace_b_w_a_p_i_1_1_tile_positions.html#a7e9fdad1975d735ff9f642f106b80264">TilePositions::Unknown</a></td><td>if an error occured while trying to retrieve the start location.</td></tr></tbody></table></dd></dl><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_game.html#a72569ecde6fc619a505cb9822cc0baa6" title="Retrieves the set of all starting locations for the current map. ">Game::getStartLocations</a>, <a class="el" href="class_b_w_a_p_i_1_1_game.html#ac10b6a4c8fb868151bef1901b859f44e" title="Returns the last error that was set using setLastError. ">Game::getLastError</a></dd></dl></div></div><a class="anchor" id="a10fd0989c7e367e7c9ad3fa7ae7468e3"></a><div class="memitem"><div class="memproto">virtual bool BWAPI::PlayerInterface::isVictorious () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Checks if the player has achieved victory. </p><dl class="section return"><dt>Returns</dt><dd>true if this player has achieved victory, otherwise false </dd></dl></div></div><a class="anchor" id="adc156dce21066e82dc83d9ad3612354a"></a><div class="memitem"><div class="memproto">virtual bool BWAPI::PlayerInterface::isDefeated () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Checks if the player has been defeated. </p><dl class="section return"><dt>Returns</dt><dd>true if the player is defeated, otherwise false </dd></dl></div></div><a class="anchor" id="ad8eff70dd2068f6139461efb87acdacc"></a><div class="memitem"><div class="memproto">virtual bool BWAPI::PlayerInterface::leftGame () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Checks if the player has left the game. </p><dl class="section return"><dt>Returns</dt><dd>true if the player has left the game, otherwise false </dd></dl></div></div><a class="anchor" id="acd1991823cf6aa521bd59c6c06766017"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::minerals () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the current amount of minerals/ore that this player has. </p><dl class="section note"><dt>Note</dt><dd>This function will return 0 if the player is inaccessible.</dd></dl><dl class="section return"><dt>Returns</dt><dd>Amount of minerals that the player currently has for spending. </dd></dl></div></div><a class="anchor" id="ae5f699ef20e5e12f1e744cc98c56e860"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::gas () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the current amount of vespene gas that this player has. </p><dl class="section note"><dt>Note</dt><dd>This function will return 0 if the player is inaccessible.</dd></dl><dl class="section return"><dt>Returns</dt><dd>Amount of gas that the player currently has for spending. </dd></dl></div></div><a class="anchor" id="a709df7d0fe07f4caf6e18d61f3b7b9e9"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::gatheredMinerals () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the cumulative amount of minerals/ore that this player has gathered since the beginning of the game, including the amount that the player starts the game with (if any). </p><dl class="section note"><dt>Note</dt><dd>This function will return 0 if the player is inaccessible.</dd></dl><dl class="section return"><dt>Returns</dt><dd>Cumulative amount of minerals that the player has gathered. </dd></dl></div></div><a class="anchor" id="a403e086136c7ff3538b8708649157d1a"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::gatheredGas () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the cumulative amount of vespene gas that this player has gathered since the beginning of the game, including the amount that the player starts the game with (if any). </p><dl class="section note"><dt>Note</dt><dd>This function will return 0 if the player is inaccessible.</dd></dl><dl class="section return"><dt>Returns</dt><dd>Cumulative amount of gas that the player has gathered. </dd></dl></div></div><a class="anchor" id="ab05ae3c3aa1f2efdee9a8fee2e2f0010"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::repairedMinerals () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the cumulative amount of minerals/ore that this player has spent on repairing units since the beginning of the game. </p><p>This function only applies to <a class="el" href="namespace_b_w_a_p_i_1_1_races.html#adc2bcfd85cc7f9881bf6e4ab1588a145">Terran</a> players.</p><dl class="section note"><dt>Note</dt><dd>This function will return 0 if the player is inaccessible.</dd></dl><dl class="section return"><dt>Returns</dt><dd>Cumulative amount of minerals that the player has spent repairing. </dd></dl></div></div><a class="anchor" id="acf2f75a71093e35ed22a751ab4928800"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::repairedGas () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the cumulative amount of vespene gas that this player has spent on repairing units since the beginning of the game. </p><p>This function only applies to <a class="el" href="namespace_b_w_a_p_i_1_1_races.html#adc2bcfd85cc7f9881bf6e4ab1588a145">Terran</a> players.</p><dl class="section note"><dt>Note</dt><dd>This function will return 0 if the player is inaccessible.</dd></dl><dl class="section return"><dt>Returns</dt><dd>Cumulative amount of gas that the player has spent repairing. </dd></dl></div></div><a class="anchor" id="ad09061d23a6bfcc50851e1ad2de7217c"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::refundedMinerals () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the cumulative amount of minerals/ore that this player has gained from refunding (cancelling) units and structures. </p><dl class="section note"><dt>Note</dt><dd>This function will return 0 if the player is inaccessible.</dd></dl><dl class="section return"><dt>Returns</dt><dd>Cumulative amount of minerals that the player has received from refunds. </dd></dl></div></div><a class="anchor" id="a372835195c5b4912208f7cff98f8a480"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::refundedGas () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the cumulative amount of vespene gas that this player has gained from refunding (cancelling) units and structures. </p><dl class="section note"><dt>Note</dt><dd>This function will return 0 if the player is inaccessible.</dd></dl><dl class="section return"><dt>Returns</dt><dd>Cumulative amount of gas that the player has received from refunds. </dd></dl></div></div><a class="anchor" id="a55dbc168a56c8f2aeb5495d6ba8e4270"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::spentMinerals () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the cumulative amount of minerals/ore that this player has spent, excluding repairs. </p><dl class="section note"><dt>Note</dt><dd>This function will return 0 if the player is inaccessible.</dd></dl><dl class="section return"><dt>Returns</dt><dd>Cumulative amount of minerals that the player has spent. </dd></dl></div></div><a class="anchor" id="a65475ddb888ae451a92dc2314fb1bf01"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::spentGas () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the cumulative amount of vespene gas that this player has spent, excluding repairs. </p><dl class="section note"><dt>Note</dt><dd>This function will return 0 if the player is inaccessible.</dd></dl><dl class="section return"><dt>Returns</dt><dd>Cumulative amount of gas that the player has spent. </dd></dl></div></div><a class="anchor" id="a1fe1b56eb1fe1c9079ae410ad3dacc6e"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::supplyTotal (<a class="el" href="class_b_w_a_p_i_1_1_race.html">Race</a> <span class="paramname"><em>race</em> = <code><a class="el" href="namespace_b_w_a_p_i_1_1_races.html#ab6642f18c4a1bf2f081a991d15b01424">Races::None</a></code></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the total amount of supply the player has available for unit control. </p><dl class="section note"><dt>Note</dt><dd>In Starcraft programming, the managed supply values are double than what they appear in the game. The reason for this is because <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#aecc7b465c9d18ee06c189bd43267e86a">Zerglings</a> use 0.5 visible supply.</dd><dd> In Starcraft, the supply for each race is separate. Having a <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#a346680c9f2748c5612e5241251cd9d2d">Pylon</a> and an <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#a5f48be167258e9c00eabebb7c6c8c85b">Overlord</a> will not give you 32 supply. It will instead give you 16 <a class="el" href="namespace_b_w_a_p_i_1_1_races.html#a90cc40290b9721f7fe1414db4f76a336">Protoss</a> supply and 16 <a class="el" href="namespace_b_w_a_p_i_1_1_races.html#ad34de4d5faa0d1703a174337fc36ab97">Zerg</a> supply.</dd></dl><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">race</td><td>(optional) The race to query the total supply for. If this is omitted, then the player's current race will be used. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>The total supply available for this player and the given <code>race</code>.</dd></dl><p>Example usage: </p><div class="fragment"><div class="line"><span class="keywordflow">if</span> ( <a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a>-><span class="keyword">self</span>()-><a class="code" href="class_b_w_a_p_i_1_1_player_interface.html#a3cda00eeda2b8edc1d015dac4f038bdb">supplyUsed</a>() + 8 >= <a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a>-><span class="keyword">self</span>()-><a class="code" href="class_b_w_a_p_i_1_1_player_interface.html#a1fe1b56eb1fe1c9079ae410ad3dacc6e">supplyTotal</a>() )</div><div class="line">{</div><div class="line"><span class="comment">// Construct pylons, supply depots, or overlords</span></div><div class="line">}</div></div><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a3cda00eeda2b8edc1d015dac4f038bdb" title="Retrieves the current amount of supply that the player is using for unit control. ...">supplyUsed</a></dd></dl></div></div><a class="anchor" id="a3cda00eeda2b8edc1d015dac4f038bdb"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::supplyUsed (<a class="el" href="class_b_w_a_p_i_1_1_race.html">Race</a> <span class="paramname"><em>race</em> = <code><a class="el" href="namespace_b_w_a_p_i_1_1_races.html#ab6642f18c4a1bf2f081a991d15b01424">Races::None</a></code></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the current amount of supply that the player is using for unit control. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">race</td><td>(optional) The race to query the used supply for. If this is omitted, then the player's current race will be used. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>The supply that is in use for this player and the given <code>race</code>. </dd></dl><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a1fe1b56eb1fe1c9079ae410ad3dacc6e" title="Retrieves the total amount of supply the player has available for unit control. ">supplyTotal</a></dd></dl></div></div><a class="anchor" id="a74dc2dc96ea64c6fcef392107d39ee9e"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::allUnitCount (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> <span class="paramname"><em>unit</em> = <code><a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869">UnitTypes::AllUnits</a></code></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the total number of units that the player has. </p><p>If the information about the player is limited, then this function will only return the number of visible units.</p><dl class="section note"><dt>Note</dt><dd>While in-progress <a class="el" href="namespace_b_w_a_p_i_1_1_races.html#a90cc40290b9721f7fe1414db4f76a336">Protoss</a> and <a class="el" href="namespace_b_w_a_p_i_1_1_races.html#adc2bcfd85cc7f9881bf6e4ab1588a145">Terran</a> units will be counted, in-progress <a class="el" href="namespace_b_w_a_p_i_1_1_races.html#ad34de4d5faa0d1703a174337fc36ab97">Zerg</a> units (i.e. inside of an egg) do not.</dd></dl><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">unit</td><td>(optional) The unit type to query. <a class="el" href="class_b_w_a_p_i_1_1_unit_type.html" title="The UnitType is used to get information about a particular type of unit, such as its cost...">UnitType</a> macros are accepted. If this parameter is omitted, then it will use <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869" title="A special macro type, used for retrieving statistics for all unit types. ">UnitTypes::AllUnits</a> by default. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>The total number of units of the given type that the player owns. </dd></dl><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a7900c982aa8ccf52c36905f0a523140e" title="Retrieves the total number of strictly visible units that the player has, even if information on the ...">visibleUnitCount</a>, <a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#acb8623f9a962eb6811faa458eb0aae03" title="Retrieves the number of completed units that the player has. ">completedUnitCount</a>, <a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a03c0ccd4319cdcbf4b83a8af2ee94ef5" title="Retrieves the number of incomplete units that the player has. ">incompleteUnitCount</a></dd></dl></div></div><a class="anchor" id="a7900c982aa8ccf52c36905f0a523140e"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::visibleUnitCount (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> <span class="paramname"><em>unit</em> = <code><a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869">UnitTypes::AllUnits</a></code></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the total number of strictly visible units that the player has, even if information on the player is unrestricted. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">unit</td><td>(optional) The unit type to query. <a class="el" href="class_b_w_a_p_i_1_1_unit_type.html" title="The UnitType is used to get information about a particular type of unit, such as its cost...">UnitType</a> macros are accepted. If this parameter is omitted, then it will use <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869" title="A special macro type, used for retrieving statistics for all unit types. ">UnitTypes::AllUnits</a> by default. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>The total number of units of the given type that the player owns, and is visible to the <a class="el" href="namespace_b_w_a_p_i.html" title="The primary namespace for the BWAPI interface. ">BWAPI</a> player. </dd></dl><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a74dc2dc96ea64c6fcef392107d39ee9e" title="Retrieves the total number of units that the player has. ">allUnitCount</a>, <a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#acb8623f9a962eb6811faa458eb0aae03" title="Retrieves the number of completed units that the player has. ">completedUnitCount</a>, <a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a03c0ccd4319cdcbf4b83a8af2ee94ef5" title="Retrieves the number of incomplete units that the player has. ">incompleteUnitCount</a></dd></dl></div></div><a class="anchor" id="acb8623f9a962eb6811faa458eb0aae03"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::completedUnitCount (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> <span class="paramname"><em>unit</em> = <code><a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869">UnitTypes::AllUnits</a></code></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the number of completed units that the player has. </p><p>If the information about the player is limited, then this function will only return the number of visible completed units.</p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">unit</td><td>(optional) The unit type to query. <a class="el" href="class_b_w_a_p_i_1_1_unit_type.html" title="The UnitType is used to get information about a particular type of unit, such as its cost...">UnitType</a> macros are accepted. If this parameter is omitted, then it will use <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869" title="A special macro type, used for retrieving statistics for all unit types. ">UnitTypes::AllUnits</a> by default. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>The number of completed units of the given type that the player owns.</dd></dl><p>Example usage: </p><div class="fragment"><div class="line"><span class="keywordtype">bool</span> obtainNextUpgrade(<a class="code" href="class_b_w_a_p_i_1_1_upgrade_type.html">BWAPI::UpgradeType</a> upgType)</div><div class="line">{</div><div class="line"><a class="code" href="class_b_w_a_p_i_1_1_player_interface.html">BWAPI::Player</a><span class="keyword">self</span> = <a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a>->self();</div><div class="line"><span class="keywordtype">int</span> maxLvl = <span class="keyword">self</span>->getMaxUpgradeLevel(upgType);</div><div class="line"><span class="keywordtype">int</span> currentLvl = <span class="keyword">self</span>->getUpgradeLevel(upgType);</div><div class="line"><span class="keywordflow">if</span> ( !self->isUpgrading(upgType) && currentLvl < maxLvl &&</div><div class="line"><span class="keyword">self</span>->completedUnitCount(upgType.<a class="code" href="class_b_w_a_p_i_1_1_upgrade_type.html#a6e42ac0e5e651de5cf96ebb47f24d210">whatsRequired</a>(currentLvl+1)) > 0 &&</div><div class="line"> self->completedUnitCount(upgType.<a class="code" href="class_b_w_a_p_i_1_1_upgrade_type.html#abb952e547641b12764bc0c17b3e48435">whatUpgrades</a>()) > 0 )</div><div class="line"><span class="keywordflow">return</span><span class="keyword">self</span>->getUnits().upgrade(upgType);</div><div class="line"><span class="keywordflow">return</span><span class="keyword">false</span>;</div><div class="line">}</div></div><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a74dc2dc96ea64c6fcef392107d39ee9e" title="Retrieves the total number of units that the player has. ">allUnitCount</a>, <a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a7900c982aa8ccf52c36905f0a523140e" title="Retrieves the total number of strictly visible units that the player has, even if information on the ...">visibleUnitCount</a>, <a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a03c0ccd4319cdcbf4b83a8af2ee94ef5" title="Retrieves the number of incomplete units that the player has. ">incompleteUnitCount</a></dd></dl></div></div><a class="anchor" id="a03c0ccd4319cdcbf4b83a8af2ee94ef5"></a><div class="memitem"><div class="memproto">int BWAPI::PlayerInterface::incompleteUnitCount (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> <span class="paramname"><em>unit</em> = <code><a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869">UnitTypes::AllUnits</a></code></span>) const</div><div class="memdoc"><p>Retrieves the number of incomplete units that the player has. </p><p>If the information about the player is limited, then this function will only return the number of visible incomplete units.</p><dl class="section note"><dt>Note</dt><dd>This function is a macro for <a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a74dc2dc96ea64c6fcef392107d39ee9e" title="Retrieves the total number of units that the player has. ">allUnitCount()</a> - <a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#acb8623f9a962eb6811faa458eb0aae03" title="Retrieves the number of completed units that the player has. ">completedUnitCount()</a>.</dd><dd> Incomplete <a class="el" href="namespace_b_w_a_p_i_1_1_races.html#ad34de4d5faa0d1703a174337fc36ab97">Zerg</a> units inside of eggs are not counted.</dd></dl><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">unit</td><td>(optional) The unit type to query. <a class="el" href="class_b_w_a_p_i_1_1_unit_type.html" title="The UnitType is used to get information about a particular type of unit, such as its cost...">UnitType</a> macros are accepted. If this parameter is omitted, then it will use <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869" title="A special macro type, used for retrieving statistics for all unit types. ">UnitTypes::AllUnits</a> by default. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>The number of incomplete units of the given type that the player owns. </dd></dl><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a74dc2dc96ea64c6fcef392107d39ee9e" title="Retrieves the total number of units that the player has. ">allUnitCount</a>, <a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a7900c982aa8ccf52c36905f0a523140e" title="Retrieves the total number of strictly visible units that the player has, even if information on the ...">visibleUnitCount</a>, <a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#acb8623f9a962eb6811faa458eb0aae03" title="Retrieves the number of completed units that the player has. ">completedUnitCount</a></dd></dl></div></div><a class="anchor" id="a3cad0d29d13fd2acfffb53f8c38db8b9"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::deadUnitCount (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> <span class="paramname"><em>unit</em> = <code><a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869">UnitTypes::AllUnits</a></code></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the number units that have died for this player. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">unit</td><td>(optional) The unit type to query. <a class="el" href="class_b_w_a_p_i_1_1_unit_type.html" title="The UnitType is used to get information about a particular type of unit, such as its cost...">UnitType</a> macros are accepted. If this parameter is omitted, then it will use <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869" title="A special macro type, used for retrieving statistics for all unit types. ">UnitTypes::AllUnits</a> by default. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>The total number of units that have died throughout the game. </dd></dl></div></div><a class="anchor" id="a2db792726d00d64d8415609b50f34158"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::killedUnitCount (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> <span class="paramname"><em>unit</em> = <code><a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869">UnitTypes::AllUnits</a></code></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the number units that the player has killed. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">unit</td><td>(optional) The unit type to query. <a class="el" href="class_b_w_a_p_i_1_1_unit_type.html" title="The UnitType is used to get information about a particular type of unit, such as its cost...">UnitType</a> macros are accepted. If this parameter is omitted, then it will use <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#af1e978d4afe2fc234c5db9f4207b7869" title="A special macro type, used for retrieving statistics for all unit types. ">UnitTypes::AllUnits</a> by default. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>The total number of units that the player has killed throughout the game. </dd></dl></div></div><a class="anchor" id="a4868817cb4c9bb9365a1a854b489c603"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::getUpgradeLevel (<a class="el" href="class_b_w_a_p_i_1_1_upgrade_type.html">UpgradeType</a> <span class="paramname"><em>upgrade</em></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the current upgrade level that the player has attained for a given upgrade type. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">upgrade</td><td>The <a class="el" href="class_b_w_a_p_i_1_1_upgrade_type.html" title="The upgrade type represents a passive upgrade that can be obtained with UnitInterface::upgrade. ">UpgradeType</a> to query. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>The number of levels that the <code>upgrade</code> has been upgraded for this player.</dd></dl><p>Example usage: </p><div class="fragment"><div class="line"><span class="keywordtype">bool</span> obtainNextUpgrade(<a class="code" href="class_b_w_a_p_i_1_1_upgrade_type.html">BWAPI::UpgradeType</a> upgType)</div><div class="line">{</div><div class="line"><a class="code" href="class_b_w_a_p_i_1_1_player_interface.html">BWAPI::Player</a><span class="keyword">self</span> = <a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a>->self();</div><div class="line"><span class="keywordtype">int</span> maxLvl = <span class="keyword">self</span>->getMaxUpgradeLevel(upgType);</div><div class="line"><span class="keywordtype">int</span> currentLvl = <span class="keyword">self</span>->getUpgradeLevel(upgType);</div><div class="line"><span class="keywordflow">if</span> ( !self->isUpgrading(upgType) && currentLvl < maxLvl &&</div><div class="line"><span class="keyword">self</span>->completedUnitCount(upgType.<a class="code" href="class_b_w_a_p_i_1_1_upgrade_type.html#a6e42ac0e5e651de5cf96ebb47f24d210">whatsRequired</a>(currentLvl+1)) > 0 &&</div><div class="line"> self->completedUnitCount(upgType.<a class="code" href="class_b_w_a_p_i_1_1_upgrade_type.html#abb952e547641b12764bc0c17b3e48435">whatUpgrades</a>()) > 0 )</div><div class="line"><span class="keywordflow">return</span><span class="keyword">self</span>->getUnits().upgrade(upgType);</div><div class="line"><span class="keywordflow">return</span><span class="keyword">false</span>;</div><div class="line">}</div></div><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_unit_interface.html#a37f7f627ad9d4df40b2046a9a88a4bef" title="Orders the unit to upgrade the given upgrade type. ">UnitInterface::upgrade</a>, <a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a21655d8959f93d8bdfcf192ca9c9d162" title="Retrieves the maximum upgrades available specific to the player. ">getMaxUpgradeLevel</a></dd></dl></div></div><a class="anchor" id="a96cd44cd47fac999044d90b0f9fc8bee"></a><div class="memitem"><div class="memproto">virtual bool BWAPI::PlayerInterface::hasResearched (<a class="el" href="class_b_w_a_p_i_1_1_tech_type.html">TechType</a> <span class="paramname"><em>tech</em></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Checks if the player has already researched a given technology. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">tech</td><td>The <a class="el" href="class_b_w_a_p_i_1_1_tech_type.html" title="The TechType (or Technology Type, also referred to as an Ability) represents a Unit's ability which c...">TechType</a> to query. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>true if the player has obtained the given <code>tech</code>, or false if they have not </dd></dl><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a01d08fa13879186156bf941403178ca3" title="Checks if the player is researching a given technology type. ">isResearching</a>, <a class="el" href="class_b_w_a_p_i_1_1_unit_interface.html#a00b77ee444c0f3eaf13c46c83529a349" title="Orders the unit to research the given tech type. ">UnitInterface::research</a>, <a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#ae6acf0903f79ab307c0a1ae8ab550d37" title="Checks if a technology can be researched by the player. ">isResearchAvailable</a></dd></dl></div></div><a class="anchor" id="a01d08fa13879186156bf941403178ca3"></a><div class="memitem"><div class="memproto">virtual bool BWAPI::PlayerInterface::isResearching (<a class="el" href="class_b_w_a_p_i_1_1_tech_type.html">TechType</a> <span class="paramname"><em>tech</em></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Checks if the player is researching a given technology type. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">tech</td><td>The <a class="el" href="class_b_w_a_p_i_1_1_tech_type.html" title="The TechType (or Technology Type, also referred to as an Ability) represents a Unit's ability which c...">TechType</a> to query. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>true if the player is currently researching the <code>tech</code>, or false otherwise </dd></dl><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_unit_interface.html#a00b77ee444c0f3eaf13c46c83529a349" title="Orders the unit to research the given tech type. ">UnitInterface::research</a>, <a class="el" href="class_b_w_a_p_i_1_1_player_interface.html#a96cd44cd47fac999044d90b0f9fc8bee" title="Checks if the player has already researched a given technology. ">hasResearched</a></dd></dl></div></div><a class="anchor" id="ad440e4acf496c81e3862b6c5c9ad100f"></a><div class="memitem"><div class="memproto">virtual bool BWAPI::PlayerInterface::isUpgrading (<a class="el" href="class_b_w_a_p_i_1_1_upgrade_type.html">UpgradeType</a> <span class="paramname"><em>upgrade</em></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Checks if the player is upgrading a given upgrade type. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">upgrade</td><td>The upgrade type to query. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>true if the player is currently upgrading the given <code>upgrade</code>, false otherwise</dd></dl><p>Example usage: </p><div class="fragment"><div class="line"><span class="keywordtype">bool</span> obtainNextUpgrade(<a class="code" href="class_b_w_a_p_i_1_1_upgrade_type.html">BWAPI::UpgradeType</a> upgType)</div><div class="line">{</div><div class="line"><a class="code" href="class_b_w_a_p_i_1_1_player_interface.html">BWAPI::Player</a><span class="keyword">self</span> = <a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a>->self();</div><div class="line"><span class="keywordtype">int</span> maxLvl = <span class="keyword">self</span>->getMaxUpgradeLevel(upgType);</div><div class="line"><span class="keywordtype">int</span> currentLvl = <span class="keyword">self</span>->getUpgradeLevel(upgType);</div><div class="line"><span class="keywordflow">if</span> ( !self->isUpgrading(upgType) && currentLvl < maxLvl &&</div><div class="line"><span class="keyword">self</span>->completedUnitCount(upgType.<a class="code" href="class_b_w_a_p_i_1_1_upgrade_type.html#a6e42ac0e5e651de5cf96ebb47f24d210">whatsRequired</a>(currentLvl+1)) > 0 &&</div><div class="line"> self->completedUnitCount(upgType.<a class="code" href="class_b_w_a_p_i_1_1_upgrade_type.html#abb952e547641b12764bc0c17b3e48435">whatUpgrades</a>()) > 0 )</div><div class="line"><span class="keywordflow">return</span><span class="keyword">self</span>->getUnits().upgrade(upgType);</div><div class="line"><span class="keywordflow">return</span><span class="keyword">false</span>;</div><div class="line">}</div></div><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_unit_interface.html#a37f7f627ad9d4df40b2046a9a88a4bef" title="Orders the unit to upgrade the given upgrade type. ">UnitInterface::upgrade</a></dd></dl></div></div><a class="anchor" id="aaab8fe611281b5d8f1c1c1193846b02c"></a><div class="memitem"><div class="memproto">virtual <a class="el" href="class_b_w_a_p_i_1_1_color.html">BWAPI::Color</a> BWAPI::PlayerInterface::getColor () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the color value of the current player. </p><dl class="section return"><dt>Returns</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_color.html" title="The Color object is used in drawing routines to specify the color to use. ">Color</a> object that represents the color of the current player. </dd></dl></div></div><a class="anchor" id="a931e38f57cddbd9a01e9d05bb1d31c5a"></a><div class="memitem"><div class="memproto">char BWAPI::PlayerInterface::getTextColor () const</div><div class="memdoc"><p>Retrieves the control code character that changes the color of text messages to represent this player. </p><dl class="section return"><dt>Returns</dt><dd>character code to use for text in Broodwar. </dd></dl></div></div><a class="anchor" id="a2bac79e0c02b668b4bb1b62c3487d55a"></a><div class="memitem"><div class="memproto">int BWAPI::PlayerInterface::maxEnergy (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> <span class="paramname"><em>unit</em></span>) const</div><div class="memdoc"><p>Retrieves the maximum amount of energy that a unit type will have, taking the player's energy upgrades into consideration. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">unit</td><td>The <a class="el" href="class_b_w_a_p_i_1_1_unit_type.html" title="The UnitType is used to get information about a particular type of unit, such as its cost...">UnitType</a> to retrieve the maximum energy for. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>Maximum amount of energy that the given unit type can have. </dd></dl></div></div><a class="anchor" id="a328b39f56a6bb6cdef426dcdbde4e533"></a><div class="memitem"><div class="memproto">double BWAPI::PlayerInterface::topSpeed (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> <span class="paramname"><em>unit</em></span>) const</div><div class="memdoc"><p>Retrieves the top speed of a unit type, taking the player's speed upgrades into consideration. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">unit</td><td>The <a class="el" href="class_b_w_a_p_i_1_1_unit_type.html" title="The UnitType is used to get information about a particular type of unit, such as its cost...">UnitType</a> to retrieve the top speed for. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>Top speed of the provided unit type for this player. </dd></dl></div></div><a class="anchor" id="a81ed329622222bfd53dc1088dba32642"></a><div class="memitem"><div class="memproto">int BWAPI::PlayerInterface::weaponMaxRange (<a class="el" href="class_b_w_a_p_i_1_1_weapon_type.html">WeaponType</a> <span class="paramname"><em>weapon</em></span>) const</div><div class="memdoc"><p>Retrieves the maximum weapon range of a weapon type, taking the player's weapon upgrades into consideration. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">weapon</td><td>The <a class="el" href="class_b_w_a_p_i_1_1_weapon_type.html" title="This object identifies a weapon type used by a unit to attack and deal damage. ">WeaponType</a> to retrieve the maximum range for. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>Maximum range of the given weapon type for units owned by this player. </dd></dl></div></div><a class="anchor" id="ab7a8f3a71aa9d8263c57624043c6e630"></a><div class="memitem"><div class="memproto">int BWAPI::PlayerInterface::sightRange (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> <span class="paramname"><em>unit</em></span>) const</div><div class="memdoc"><p>Retrieves the sight range of a unit type, taking the player's sight range upgrades into consideration. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">unit</td><td>The <a class="el" href="class_b_w_a_p_i_1_1_unit_type.html" title="The UnitType is used to get information about a particular type of unit, such as its cost...">UnitType</a> to retrieve the sight range for. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>Sight range of the provided unit type for this player. </dd></dl></div></div><a class="anchor" id="a201505286ef56cbbe540f05f76e50624"></a><div class="memitem"><div class="memproto">int BWAPI::PlayerInterface::weaponDamageCooldown (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> <span class="paramname"><em>unit</em></span>) const</div><div class="memdoc"><p>Retrieves the weapon cooldown of a unit type, taking the player's attack speed upgrades into consideration. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">unit</td><td>The <a class="el" href="class_b_w_a_p_i_1_1_unit_type.html" title="The UnitType is used to get information about a particular type of unit, such as its cost...">UnitType</a> to retrieve the damage cooldown for. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>Weapon cooldown of the provided unit type for this player. </dd></dl></div></div><a class="anchor" id="a68ee4e16151133896b5292c122221cd9"></a><div class="memitem"><div class="memproto">int BWAPI::PlayerInterface::armor (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> <span class="paramname"><em>unit</em></span>) const</div><div class="memdoc"><p>Calculates the armor that a given unit type will have, including upgrades. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">unit</td><td>The unit type to calculate armor for, using the current player's upgrades. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>The amount of armor that the unit will have with the player's upgrades. </dd></dl></div></div><a class="anchor" id="a5c601001f65b2d7db66bf175e81f939a"></a><div class="memitem"><div class="memproto">int BWAPI::PlayerInterface::damage (<a class="el" href="class_b_w_a_p_i_1_1_weapon_type.html">WeaponType</a> <span class="paramname"><em>wpn</em></span>) const</div><div class="memdoc"><p>Calculates the damage that a given weapon type can deal, including upgrades. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">wpn</td><td>The weapon type to calculate for. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>The amount of damage that the weapon deals with this player's upgrades. </dd></dl></div></div><a class="anchor" id="a7cbf6db84723ab8f9432fbb80ea6b4fa"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::getUnitScore () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the total unit score, as seen in the end-game score screen. </p><dl class="section return"><dt>Returns</dt><dd>The player's unit score. </dd></dl></div></div><a class="anchor" id="a2362c952155c160e4dcd02c9cf2c87c5"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::getKillScore () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the total kill score, as seen in the end-game score screen. </p><dl class="section return"><dt>Returns</dt><dd>The player's kill score. </dd></dl></div></div><a class="anchor" id="a5d89e6dbc9e4d9e6dc0d17488a6314a6"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::getBuildingScore () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the total building score, as seen in the end-game score screen. </p><dl class="section return"><dt>Returns</dt><dd>The player's building score. </dd></dl></div></div><a class="anchor" id="a7451a3a7882ab96b3b3a83becc734e6e"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::getRazingScore () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the total razing score, as seen in the end-game score screen. </p><dl class="section return"><dt>Returns</dt><dd>The player's razing score. </dd></dl></div></div><a class="anchor" id="a6c78736629b8f07b76e263ae40ae016c"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::getCustomScore () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the player's custom score. </p><p>This score is used in <a class="el" href="namespace_b_w_a_p_i_1_1_game_types.html#ad49903c20bd1fa93215f8f0f23d07008">Use Map Settings</a> game types.</p><dl class="section return"><dt>Returns</dt><dd>The player's custom score. </dd></dl></div></div><a class="anchor" id="ae5e9f15c8c870486362117d24e906c55"></a><div class="memitem"><div class="memproto">virtual bool BWAPI::PlayerInterface::isObserver () const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Checks if the player is an observer player, typically in a <a class="el" href="namespace_b_w_a_p_i_1_1_game_types.html#ad49903c20bd1fa93215f8f0f23d07008">Use Map Settings</a> observer game. </p><p>An observer player does not participate in the game.</p><dl class="section return"><dt>Returns</dt><dd>true if the player is observing, or false if the player is capable of playing in the game. </dd></dl></div></div><a class="anchor" id="a21655d8959f93d8bdfcf192ca9c9d162"></a><div class="memitem"><div class="memproto">virtual int BWAPI::PlayerInterface::getMaxUpgradeLevel (<a class="el" href="class_b_w_a_p_i_1_1_upgrade_type.html">UpgradeType</a> <span class="paramname"><em>upgrade</em></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Retrieves the maximum upgrades available specific to the player. </p><p>This value is only different from <a class="el" href="class_b_w_a_p_i_1_1_upgrade_type.html#a00371d236537a8fe4efe51e559abd186" title="Returns the maximum number of times the upgrade can be researched. ">UpgradeType::maxRepeats</a> in <a class="el" href="namespace_b_w_a_p_i_1_1_game_types.html#ad49903c20bd1fa93215f8f0f23d07008">Use Map Settings</a> games.</p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">upgrade</td><td>The <a class="el" href="class_b_w_a_p_i_1_1_upgrade_type.html" title="The upgrade type represents a passive upgrade that can be obtained with UnitInterface::upgrade. ">UpgradeType</a> to retrieve the maximum upgrade level for. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>Maximum upgrade level of the given <code>upgrade</code> type.</dd></dl><p>Example usage: </p><div class="fragment"><div class="line"><span class="keywordtype">bool</span> obtainNextUpgrade(<a class="code" href="class_b_w_a_p_i_1_1_upgrade_type.html">BWAPI::UpgradeType</a> upgType)</div><div class="line">{</div><div class="line"><a class="code" href="class_b_w_a_p_i_1_1_player_interface.html">BWAPI::Player</a><span class="keyword">self</span> = <a class="code" href="namespace_b_w_a_p_i.html#a0858264e08a7273886488efc5f5ba64c">BWAPI::Broodwar</a>->self();</div><div class="line"><span class="keywordtype">int</span> maxLvl = <span class="keyword">self</span>->getMaxUpgradeLevel(upgType);</div><div class="line"><span class="keywordtype">int</span> currentLvl = <span class="keyword">self</span>->getUpgradeLevel(upgType);</div><div class="line"><span class="keywordflow">if</span> ( !self->isUpgrading(upgType) && currentLvl < maxLvl &&</div><div class="line"><span class="keyword">self</span>->completedUnitCount(upgType.<a class="code" href="class_b_w_a_p_i_1_1_upgrade_type.html#a6e42ac0e5e651de5cf96ebb47f24d210">whatsRequired</a>(currentLvl+1)) > 0 &&</div><div class="line"> self->completedUnitCount(upgType.<a class="code" href="class_b_w_a_p_i_1_1_upgrade_type.html#abb952e547641b12764bc0c17b3e48435">whatUpgrades</a>()) > 0 )</div><div class="line"><span class="keywordflow">return</span><span class="keyword">self</span>->getUnits().upgrade(upgType);</div><div class="line"><span class="keywordflow">return</span><span class="keyword">false</span>;</div><div class="line">}</div></div></div></div><a class="anchor" id="ae6acf0903f79ab307c0a1ae8ab550d37"></a><div class="memitem"><div class="memproto">virtual bool BWAPI::PlayerInterface::isResearchAvailable (<a class="el" href="class_b_w_a_p_i_1_1_tech_type.html">TechType</a> <span class="paramname"><em>tech</em></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Checks if a technology can be researched by the player. </p><p>Certain technologies may be disabled in <a class="el" href="namespace_b_w_a_p_i_1_1_game_types.html#ad49903c20bd1fa93215f8f0f23d07008">Use Map Settings</a> game types.</p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">tech</td><td>The <a class="el" href="class_b_w_a_p_i_1_1_tech_type.html" title="The TechType (or Technology Type, also referred to as an Ability) represents a Unit's ability which c...">TechType</a> to query. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>true if the <code>tech</code> type is available to the player for research. </dd></dl></div></div><a class="anchor" id="a5c2eb71bb2aab487474093d1a532e848"></a><div class="memitem"><div class="memproto">virtual bool BWAPI::PlayerInterface::isUnitAvailable (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> <span class="paramname"><em>unit</em></span>) const <span class="mlabels"><span class="mlabel">pure virtual</span></span></div><div class="memdoc"><p>Checks if a unit type can be created by the player. </p><p>Certain unit types may be disabled in <a class="el" href="namespace_b_w_a_p_i_1_1_game_types.html#ad49903c20bd1fa93215f8f0f23d07008">Use Map Settings</a> game types.</p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">unit</td><td>The <a class="el" href="class_b_w_a_p_i_1_1_unit_type.html" title="The UnitType is used to get information about a particular type of unit, such as its cost...">UnitType</a> to check. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>true if the <code>unit</code> type is available to the player. </dd></dl></div></div><a class="anchor" id="af1bbbc518426ad4119f52549548a8c91"></a><div class="memitem"><div class="memproto">bool BWAPI::PlayerInterface::hasUnitTypeRequirement (<a class="el" href="class_b_w_a_p_i_1_1_unit_type.html">UnitType</a> <span class="paramname"><em>unit</em>, </span>int <span class="paramname"><em>amount</em> = <code>1</code> </span>) const</div><div class="memdoc"><p>Verifies that this player satisfies a unit type requirement. </p><p>This verifies complex type requirements involving morphable <a class="el" href="namespace_b_w_a_p_i_1_1_races.html#ad34de4d5faa0d1703a174337fc36ab97">Zerg</a> structures. For example, if something requires a <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#a6da0d8c81764b3205d7e04763805aa1e">Spire</a>, but the player has (or is in the process of morphing) a <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#ac3b9dbf9c99382dbfc1967d100367f46">Greater Spire</a>, this function will identify the requirement. It is simply a convenience function that performs all of the requirement checks.</p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">unit</td><td>The <a class="el" href="class_b_w_a_p_i_1_1_unit_type.html" title="The UnitType is used to get information about a particular type of unit, such as its cost...">UnitType</a> to check. </td></tr><tr><td class="paramname">amount</td><td>(optional) The amount of units that are required. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>true if the unit type requirements are met, and false otherwise.</dd></dl><dl class="section since"><dt>Since</dt><dd>4.1.2 </dd></dl></div></div></div><hr class="footer"><address class="footer"><div style="float:left;" id="google_translate_element"></div><script>if(window.location.protocol!="file:"){function googleTranslateElementInit(){new google.translate.TranslateElement({pageLanguage:"en",layout:google.translate.TranslateElement.InlineLayout.HORIZONTAL},"google_translate_element")}var js=document.createElement("script");js.type="text/javascript";js.src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit";document.body.appendChild(js)};</script><small> Generated on Wed Apr 19 2017 09:26:58 for BWAPI by <a href="//www.doxygen.org/index.html"><img style="width:104px;height:31px;" class="footer" src="doxygen.png" alt="doxygen"></a> 1.8.11 </small></address><script src="jquery.js"></script><script src="dynsections.js"></script><script>$(document).ready(function(){searchBox.OnSelectItem(0);$(".memberdecls, .memname, .memproto, .paramname, .fieldname, .entry, .fragment").addClass("notranslate");$("#MSearchResultsWindow").addClass("notranslate");$(".qindex, .qindex + table").addClass("notranslate");$(".contents > ul").addClass("notranslate");$(".contents > h3").addClass("notranslate");$("#navrow4 > .tablist > li > a").addClass("notranslate");$("a.el, a.elRef").addClass("notranslate")});</script></body></html>