-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclass_b_w_a_p_i_1_1_interface.html
More file actions
1 lines (1 loc) · 14.5 KB
/
class_b_w_a_p_i_1_1_interface.html
File metadata and controls
1 lines (1 loc) · 14.5 KB
1
<!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>BWAPI: BWAPI::Interface< T > Class Template 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_interface.html">Interface</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_interface-members.html">List of all members</a></div><div class="headertitle"><div class="title">BWAPI::Interface< T > Class Template Reference</div></div></div><div class="contents"><div class="dynheader"> Inheritance diagram for BWAPI::Interface< T >:</div><div class="dyncontent"><div class="center"><img src="class_b_w_a_p_i_1_1_interface__inherit__graph.png" usemap="#_b_w_a_p_i_1_1_interface_3_01_t_01_4_inherit__map" alt="Inheritance graph"></div><map name="_b_w_a_p_i_1_1_interface_3_01_t_01_4_inherit__map" id="_b_w_a_p_i_1_1_interface_3_01_t_01_4_inherit__map"><area shape="rect" id="node3" href="class_b_w_a_p_i_1_1_game.html" title="The abstract Game class is implemented by BWAPI and is the primary means of obtaining all game state ..." alt="" coords="640,5,748,33"><area shape="rect" id="node5" href="class_b_w_a_p_i_1_1_force_interface.html" title="The Force class is used to get information about each force in a match. " alt="" coords="615,56,773,83"><area shape="rect" id="node7" href="class_b_w_a_p_i_1_1_unit_interface.html" title="The Unit class is used to get information about individual units as well as issue orders to units..." alt="" coords="620,107,767,134"><area shape="rect" id="node9" href="class_b_w_a_p_i_1_1_bullet_interface.html" title="An interface object representing a bullet or missile spawned from an attack. " alt="" coords="615,165,772,193"><area shape="rect" id="node11" href="class_b_w_a_p_i_1_1_player_interface.html" title="The Player represents a unique controller in the game. " alt="" coords="613,232,774,259"><area shape="rect" id="node13" href="class_b_w_a_p_i_1_1_region_interface.html" title="Region objects are created by Starcraft: Broodwar to contain several tiles with the same properties..." alt="" coords="611,299,777,326"></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">void * </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_interface.html#a3aa3b5106a3e15f761d722a7700d968f">getClientInfo</a> (int key=0) const </td></tr><tr><td class="memTemplParams" colspan="2">template<typename CT > </td></tr><tr><td class="memTemplItemLeft" align="right" valign="top">CT </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_b_w_a_p_i_1_1_interface.html#a53bfd1f718ac2fd7737d02c4e2b76aaf">getClientInfo</a> (int key=0) const </td></tr><tr><td class="memItemLeft">void </td><td class="memItemRight"><a class="el" href="class_b_w_a_p_i_1_1_interface.html#a8b577bbffb372ba99db11a495366cd3b">registerEvent</a> (const <a class="elRef" href="//en.cppreference.com/w/cpp/utility/functional/function.html">std::function</a>< void(T *)> &action, const <a class="elRef" href="//en.cppreference.com/w/cpp/utility/functional/function.html">std::function</a>< bool(T *)> &condition=nullptr, int timesToRun=-1, int framesToCheck=0)</td></tr><tr><td class="memTemplParams" colspan="2">template<typename V > </td></tr><tr><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_b_w_a_p_i_1_1_interface.html#a9b8786ff8e075befc5e1460443f66f7c">setClientInfo</a> (const V &clientInfo, int key=0)</td></tr></tbody></table><a id="details"></a><h2 class="groupheader">Detailed Description</h2><div class="textblock"><h3>template<typename T><br> class BWAPI::Interface< T ></h3><p>This generalized class allows the application of features that are common to all interface classes. </p><dl class="tparams"><dt>Template Parameters</dt><dd><table class="tparams"><tbody><tr><td class="paramname">T</td><td>The class that inherits this interface. </td></tr></tbody></table></dd></dl></div><h2 class="groupheader">Member Function Documentation</h2><a class="anchor" id="a3aa3b5106a3e15f761d722a7700d968f"></a><div class="memitem"><div class="memproto">void* <a class="el" href="class_b_w_a_p_i_1_1_interface.html">BWAPI::Interface</a>< T >::getClientInfo (int <span class="paramname"><em>key</em> = <code>0</code></span>) const</div><div class="memdoc"><p>Retrieves a pointer or value at an index that was stored for this interface using setClientInfo. </p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">key</td><td>The key containing the value to retrieve. Default is 0. </td></tr></tbody></table></dd></dl><dl class="retval"><dt>Return values</dt><dd><table class="retval"><tbody><tr><td class="paramname">nullptr</td><td>if index is out of bounds. </td></tr></tbody></table></dd></dl><dl class="section return"><dt>Returns</dt><dd>The client info at the given index. </dd></dl><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_b_w_a_p_i_1_1_interface.html#a9b8786ff8e075befc5e1460443f66f7c" title="Associates one or more pointers or values with any BWAPI interface. ">setClientInfo</a></dd></dl><p>Referenced by <a class="el" href="class_b_w_a_p_i_1_1_interface.html#a53bfd1f718ac2fd7737d02c4e2b76aaf">BWAPI::Interface< T >::getClientInfo()</a>.</p></div></div><a class="anchor" id="a53bfd1f718ac2fd7737d02c4e2b76aaf"></a><div class="memitem"><div class="memproto">CT <a class="el" href="class_b_w_a_p_i_1_1_interface.html">BWAPI::Interface</a>< T >::getClientInfo (int <span class="paramname"><em>key</em> = <code>0</code></span>) const</div><div class="memdoc"><p>References <a class="el" href="class_b_w_a_p_i_1_1_interface.html#a3aa3b5106a3e15f761d722a7700d968f">BWAPI::Interface< T >::getClientInfo()</a>.</p></div></div><a class="anchor" id="a9b8786ff8e075befc5e1460443f66f7c"></a><div class="memitem"><div class="memproto">void <a class="el" href="class_b_w_a_p_i_1_1_interface.html">BWAPI::Interface</a>< T >::setClientInfo (const V & <span class="paramname"><em>clientInfo</em>, </span>int <span class="paramname"><em>key</em> = <code>0</code> </span>)</div><div class="memdoc"><p>Associates one or more pointers or values with any <a class="el" href="namespace_b_w_a_p_i.html" title="The primary namespace for the BWAPI interface. ">BWAPI</a> interface. </p><p>This client information is managed entirely by the AI module. It is not modified by <a class="el" href="namespace_b_w_a_p_i.html" title="The primary namespace for the BWAPI interface. ">BWAPI</a>. </p><dl class="section warning"><dt>Warning</dt><dd>If a pointer to allocated memory is used, then the AI module is responsible for deallocating the memory when the game ends.</dd></dl><p>If client info at the given index has already been set, then it will be overwritten.</p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">clientInfo</td><td>The data to associate with this interface. </td></tr><tr><td class="paramname">key</td><td>The key to use for this data. Default is 0. </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_interface.html#a3aa3b5106a3e15f761d722a7700d968f" title="Retrieves a pointer or value at an index that was stored for this interface using setClientInfo...">getClientInfo</a></dd></dl></div></div><a class="anchor" id="a8b577bbffb372ba99db11a495366cd3b"></a><div class="memitem"><div class="memproto">void <a class="el" href="class_b_w_a_p_i_1_1_interface.html">BWAPI::Interface</a>< T >::registerEvent (const <a class="elRef" href="//en.cppreference.com/w/cpp/utility/functional/function.html">std::function</a>< void(T *)> & <span class="paramname"><em>action</em>, </span>const <a class="elRef" href="//en.cppreference.com/w/cpp/utility/functional/function.html">std::function</a>< bool(T *)> & <span class="paramname"><em>condition</em> = <code>nullptr</code>, </span>int <span class="paramname"><em>timesToRun</em> = <code>-1</code>, </span>int <span class="paramname"><em>framesToCheck</em> = <code>0</code> </span>)</div><div class="memdoc"><p>Registers an event and associates it with the current <a class="el" 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...">Interface</a> object. </p><p>Events can be used to automate tasks (like train X <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#afdd1eb3e3e948529e0910281d0026d7c">Marines</a> until Y of them have been created by the given <a class="el" href="namespace_b_w_a_p_i_1_1_unit_types.html#a21ec4f7943eb5dad994ea443e55ce170">Barracks</a>) or to create user-defined callbacks.</p><dl class="params"><dt>Parameters</dt><dd><table class="params"><tbody><tr><td class="paramname">action</td><td>The action callback to be executed when the event conditions are true. It is of type void fn(T *inst) where fn is the function name and inst is a pointer to the instance of the object performing the action. </td></tr><tr><td class="paramname">condition</td><td>(optional) The condition callback which will return true if the action is intended to be executed. It is of type bool fn(T *inst) where fn is the function name and inst is a pointer to the instance of the object performing the check. The condition will always be true if omitted. </td></tr><tr><td class="paramname">timesToRun</td><td>(optional) The number of times to execute the action before the event is removed. If the value is negative, then the event will never be removed. The value will be -1 if omitted, causing the event to execute until the game ends. </td></tr><tr><td class="paramname">framesToCheck</td><td>(optional) The number of frames to skip between checks. If this value is 0, then a condition check is made once per frame. If this value is 1, then the condition for this event is only checked every other frame. This value is 0 by default, meaning the event's condition is checked every frame. </td></tr></tbody></table></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>