⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 formations_8c-source.html

📁 仿真人工智能是指用人工的方法和技术
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Formations.C Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body bgcolor="#ffffff"><!-- Generated by Doxygen 1.2.12 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>Formations.C</h1><a href="Formations_8C.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/*</font>00002 <font class="comment">Copyright (c) 2000,2001, Jelle Kok, University of Amsterdam</font>00003 <font class="comment">All rights reserved.</font>00004 <font class="comment"></font>00005 <font class="comment">Redistribution and use in source and binary forms, with or without </font>00006 <font class="comment">modification, are permitted provided that the following conditions are met:</font>00007 <font class="comment"></font>00008 <font class="comment">1. Redistributions of source code must retain the above copyright notice, this </font>00009 <font class="comment">list of conditions and the following disclaimer. </font>00010 <font class="comment"></font>00011 <font class="comment">2. Redistributions in binary form must reproduce the above copyright notice, </font>00012 <font class="comment">this list of conditions and the following disclaimer in the documentation </font>00013 <font class="comment">and/or other materials provided with the distribution. </font>00014 <font class="comment"></font>00015 <font class="comment">3. Neither the name of the University of Amsterdam nor the names of its </font>00016 <font class="comment">contributors may be used to endorse or promote products derived from this </font>00017 <font class="comment">software without specific prior written permission. </font>00018 <font class="comment"></font>00019 <font class="comment">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" </font>00020 <font class="comment">AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE </font>00021 <font class="comment">IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE </font>00022 <font class="comment">DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE </font>00023 <font class="comment">FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL </font>00024 <font class="comment">DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR </font>00025 <font class="comment">SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER </font>00026 <font class="comment">CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, </font>00027 <font class="comment">OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE </font>00028 <font class="comment">OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</font>00029 <font class="comment">*/</font>00043 <font class="preprocessor">#include "<a class="code" href="Formations_8h.html">Formations.h</a>"</font>00044 <font class="preprocessor">#include "<a class="code" href="Parse_8h.html">Parse.h</a>"</font>       <font class="comment">// Parse</font>00045 00046 <font class="preprocessor">#include &lt;fstream.h&gt;</font>     <font class="comment">// ifstream</font>00047 <font class="preprocessor">#include &lt;stdio.h&gt;</font>       <font class="comment">// printf</font>00048 <font class="preprocessor">#include &lt;math.h&gt;</font>        <font class="comment">// fabs</font>00049 00050 <font class="comment">/******************************************************************************/</font>00051 <font class="comment">/********************** CLASS PLAYERTYPEINFO **********************************/</font>00052 <font class="comment">/******************************************************************************/</font>00053 <a name="l00059"></a><a class="code" href="classPlayerTypeInfo.html#a0">00059</a> <a class="code" href="classPlayerTypeInfo.html#a0">PlayerTypeInfo::PlayerTypeInfo</a>()00060 {00061   <a class="code" href="classPlayerTypeInfo.html#a2">setValues</a>( <a class="code" href="SoccerTypes_8h.html#a248a192">PT_ILLEGAL</a>, <a class="code" href="SoccerTypes_8h.html#a19">UnknownDoubleValue</a>,<a class="code" href="SoccerTypes_8h.html#a19">UnknownDoubleValue</a>,00062              <a class="code" href="SoccerTypes_8h.html#a19">UnknownDoubleValue</a>, <a class="code" href="SoccerTypes_8h.html#a19">UnknownDoubleValue</a>, <font class="keyword">false</font>);00063 }00064 <a name="l00074"></a><a class="code" href="classPlayerTypeInfo.html#a1">00074</a> <a class="code" href="classPlayerTypeInfo.html#a0">PlayerTypeInfo::PlayerTypeInfo</a>( <a class="code" href="SoccerTypes_8h.html#a248">PlayerT</a> pt, <font class="keywordtype">double</font> dAttrX, <font class="keywordtype">double</font> dAttrY,00075                                 <font class="keywordtype">double</font> dMinX, <font class="keywordtype">double</font> dMaxX, <font class="keywordtype">bool</font> bBehindBall )00076 {00077   <a class="code" href="classPlayerTypeInfo.html#a2">setValues</a>( pt, <a class="code" href="classPlayerTypeInfo.html#o1">dAttrX</a>, <a class="code" href="classPlayerTypeInfo.html#o2">dAttrY</a>, <a class="code" href="classPlayerTypeInfo.html#o3">dMinX</a>, <a class="code" href="classPlayerTypeInfo.html#o4">dMaxX</a>, <a class="code" href="classPlayerTypeInfo.html#o5">bBehindBall</a> );00078 }00079 <a name="l00090"></a><a class="code" href="classPlayerTypeInfo.html#a2">00090</a> <font class="keywordtype">bool</font> <a class="code" href="classPlayerTypeInfo.html#a2">PlayerTypeInfo::setValues</a>( <a class="code" href="SoccerTypes_8h.html#a248">PlayerT</a> pt,   <font class="keywordtype">double</font> ax,   <font class="keywordtype">double</font> ay,00091                                 <font class="keywordtype">double</font> minx,  <font class="keywordtype">double</font> maxx, <font class="keywordtype">bool</font> bb)00092 {00093   <a class="code" href="classPlayerTypeInfo.html#o0">playerType</a>  = pt;00094   <a class="code" href="classPlayerTypeInfo.html#o1">dAttrX</a>      = ax;00095   <a class="code" href="classPlayerTypeInfo.html#o2">dAttrY</a>      = ay;00096   <a class="code" href="classPlayerTypeInfo.html#o3">dMinX</a>       = minx;00097   <a class="code" href="classPlayerTypeInfo.html#o4">dMaxX</a>       = maxx;00098   <a class="code" href="classPlayerTypeInfo.html#o5">bBehindBall</a> = bb;00099 00100   <font class="keywordflow">return</font> <font class="keyword">true</font>;00101 }00102 <a name="l00106"></a><a class="code" href="classPlayerTypeInfo.html#a3">00106</a> <font class="keywordtype">void</font> <a class="code" href="classPlayerTypeInfo.html#a3">PlayerTypeInfo::show</a>( ostream &amp;os )00107 {00108   os &lt;&lt; <font class="stringliteral">"("</font> &lt;&lt; (int)<a class="code" href="classPlayerTypeInfo.html#o0">playerType</a> &lt;&lt; <font class="stringliteral">", "</font> &lt;&lt; <a class="code" href="classPlayerTypeInfo.html#o1">dAttrX</a> &lt;&lt; <font class="stringliteral">", "</font> &lt;&lt; <a class="code" href="classPlayerTypeInfo.html#o2">dAttrY</a> &lt;&lt; <font class="stringliteral">", "</font>00109             &lt;&lt; <a class="code" href="classPlayerTypeInfo.html#o3">dMinX</a>           &lt;&lt; <font class="stringliteral">", "</font> &lt;&lt; <a class="code" href="classPlayerTypeInfo.html#o4">dMaxX</a>  &lt;&lt; <font class="stringliteral">", "</font> &lt;&lt; <a class="code" href="classPlayerTypeInfo.html#o5">bBehindBall</a> &lt;&lt; <font class="stringliteral">")"</font>00110             &lt;&lt; endl;00111 00112 }00113 <a name="l00117"></a><a class="code" href="classPlayerTypeInfo.html#a4">00117</a> <font class="keywordtype">bool</font> <a class="code" href="classPlayerTypeInfo.html#a4">PlayerTypeInfo::setPlayerType</a>( <a class="code" href="SoccerTypes_8h.html#a248">PlayerT</a> type )00118 {00119   <a class="code" href="classPlayerTypeInfo.html#o0">playerType</a> = type;00120   <font class="keywordflow">return</font> <font class="keyword">true</font>;00121 }00122 <a name="l00125"></a><a class="code" href="classPlayerTypeInfo.html#a5">00125</a> <a class="code" href="SoccerTypes_8h.html#a248">PlayerT</a> <a class="code" href="classPlayerTypeInfo.html#a5">PlayerTypeInfo::getPlayerType</a>( )<font class="keyword"> const</font>00126 <font class="keyword"></font>{00127   <font class="keywordflow">return</font> <a class="code" href="classPlayerTypeInfo.html#o0">playerType</a>;00128 }00129 <a name="l00138"></a><a class="code" href="classPlayerTypeInfo.html#a6">00138</a> <font class="keywordtype">bool</font> <a class="code" href="classPlayerTypeInfo.html#a6">PlayerTypeInfo::setAttrX</a>( <font class="keywordtype">double</font> dAttractionX )00139 {00140   <a class="code" href="classPlayerTypeInfo.html#o1">dAttrX</a> = dAttractionX;00141   <font class="keywordflow">return</font> <font class="keyword">true</font>;00142 }00143 <a name="l00151"></a><a class="code" href="classPlayerTypeInfo.html#a7">00151</a> <font class="keywordtype">double</font> <a class="code" href="classPlayerTypeInfo.html#a7">PlayerTypeInfo::getAttrX</a>( )<font class="keyword"> const</font>00152 <font class="keyword"></font>{00153   <font class="keywordflow">return</font> <a class="code" href="classPlayerTypeInfo.html#o1">dAttrX</a>;00154 }00155 <a name="l00164"></a><a class="code" href="classPlayerTypeInfo.html#a8">00164</a> <font class="keywordtype">bool</font> <a class="code" href="classPlayerTypeInfo.html#a8">PlayerTypeInfo::setAttrY</a>( <font class="keywordtype">double</font> dAttractionY )00165 {00166   <a class="code" href="classPlayerTypeInfo.html#o2">dAttrY</a> = dAttractionY;00167   <font class="keywordflow">return</font> <font class="keyword">true</font>;00168 }00169 <a name="l00177"></a><a class="code" href="classPlayerTypeInfo.html#a9">00177</a> <font class="keywordtype">double</font> <a class="code" href="classPlayerTypeInfo.html#a9">PlayerTypeInfo::getAttrY</a>( )<font class="keyword"> const</font>00178 <font class="keyword"></font>{00179   <font class="keywordflow">return</font> <a class="code" href="classPlayerTypeInfo.html#o2">dAttrY</a>;00180 }00181 <a name="l00187"></a><a class="code" href="classPlayerTypeInfo.html#a10">00187</a> <font class="keywordtype">bool</font> <a class="code" href="classPlayerTypeInfo.html#a10">PlayerTypeInfo::setMinX</a>( <font class="keywordtype">double</font> dMinimalX )00188 {00189   <a class="code" href="classPlayerTypeInfo.html#o3">dMinX</a> = dMinimalX;00190   <font class="keywordflow">return</font> <font class="keyword">true</font>;00191 }00192 <a name="l00197"></a><a class="code" href="classPlayerTypeInfo.html#a11">00197</a> <font class="keywordtype">double</font> <a class="code" href="classPlayerTypeInfo.html#a11">PlayerTypeInfo::getMinX</a>( )<font class="keyword"> const</font>00198 <font class="keyword"></font>{00199   <font class="keywordflow">return</font> <a class="code" href="classPlayerTypeInfo.html#o3">dMinX</a>;00200 }00201 <a name="l00207"></a><a class="code" href="classPlayerTypeInfo.html#a12">00207</a> <font class="keywordtype">bool</font> <a class="code" href="classPlayerTypeInfo.html#a12">PlayerTypeInfo::setMaxX</a>( <font class="keywordtype">double</font> dMaximalX )00208 {00209   <a class="code" href="classPlayerTypeInfo.html#o4">dMaxX</a> = dMaximalX;00210   <font class="keywordflow">return</font> <font class="keyword">true</font>;00211 }00212 <a name="l00217"></a><a class="code" href="classPlayerTypeInfo.html#a13">00217</a> <font class="keywordtype">double</font> <a class="code" href="classPlayerTypeInfo.html#a13">PlayerTypeInfo::getMaxX</a>( )<font class="keyword"> const</font>00218 <font class="keyword"></font>{00219   <font class="keywordflow">return</font> <a class="code" href="classPlayerTypeInfo.html#o4">dMaxX</a>;00220 }00221 <a name="l00229"></a><a class="code" href="classPlayerTypeInfo.html#a14">00229</a> <font class="keywordtype">bool</font> <a class="code" href="classPlayerTypeInfo.html#a14">PlayerTypeInfo::setBehindBall</a>( <font class="keywordtype">bool</font> b )00230 {00231   <a class="code" href="classPlayerTypeInfo.html#o5">bBehindBall</a> = b;00232   <font class="keywordflow">return</font> <font class="keyword">true</font>;00233 }00234 <a name="l00241"></a><a class="code" href="classPlayerTypeInfo.html#a15">00241</a> <font class="keywordtype">bool</font> <a class="code" href="classPlayerTypeInfo.html#a15">PlayerTypeInfo::getBehindBall</a>( )<font class="keyword"> const</font>00242 <font class="keyword"></font>{00243   <font class="keywordflow">return</font> <a class="code" href="classPlayerTypeInfo.html#o5">bBehindBall</a>;00244 }00245 00246 <font class="comment">/******************************************************************************/</font>00247 <font class="comment">/********************** CLASS FORMATIONTYPEINFO********************************/</font>00248 <font class="comment">/******************************************************************************/</font>00249 <a name="l00251"></a><a class="code" href="classFormationTypeInfo.html#a0">00251</a> <a class="code" href="classFormationTypeInfo.html#a0">FormationTypeInfo::FormationTypeInfo</a>( )00252 {00253 }00254 <a name="l00258"></a><a class="code" href="classFormationTypeInfo.html#a2">00258</a> <font class="keywordtype">bool</font> <a class="code" href="classFormationTypeInfo.html#a2">FormationTypeInfo::setFormationType</a>( <a class="code" href="SoccerTypes_8h.html#a249">FormationT</a> type )00259 {00260   <a class="code" href="classFormationTypeInfo.html#o0">formationType</a> = type;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -