Initial commit
[trapthecap.git] / doc / classes / Potential_player.html
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE html
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
8 <title>Class: Potential_player</title>
9 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10 <meta http-equiv="Content-Script-Type" content="text/javascript" />
11 <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12 <script type="text/javascript">
13 // <![CDATA[
14
15 function popupCode( url ) {
16 window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17 }
18
19 function toggleCode( id ) {
20 if ( document.getElementById )
21 elem = document.getElementById( id );
22 else if ( document.all )
23 elem = eval( "document.all." + id );
24 else
25 return false;
26
27 elemStyle = elem.style;
28
29 if ( elemStyle.display != "block" ) {
30 elemStyle.display = "block"
31 } else {
32 elemStyle.display = "none"
33 }
34
35 return true;
36 }
37
38 // Make codeblocks hidden by default
39 document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
41 // ]]>
42 </script>
43
44 </head>
45 <body>
46
47
48
49 <div id="classHeader">
50 <table class="header-table">
51 <tr class="top-aligned-row">
52 <td><strong>Class</strong></td>
53 <td class="class-name-in-header">Potential_player</td>
54 </tr>
55 <tr class="top-aligned-row">
56 <td><strong>In:</strong></td>
57 <td>
58 <a href="../files/lib/libpplayer_rb.html">
59 lib/libpplayer.rb
60 </a>
61 <br />
62 </td>
63 </tr>
64
65 <tr class="top-aligned-row">
66 <td><strong>Parent:</strong></td>
67 <td>
68 Object
69 </td>
70 </tr>
71 </table>
72 </div>
73 <!-- banner header -->
74
75 <div id="bodyContent">
76
77
78
79 <div id="contextContent">
80
81 <div id="description">
82 <p>
83 Play Trap the Cap by using potential fields. For each possible move,
84 calculate the field strength and pick the move with the lowest potential
85 </p>
86
87 </div>
88
89
90 </div>
91
92 <div id="method-list">
93 <h3 class="section-bar">Methods</h3>
94
95 <div class="name-list">
96 <a href="#M000007">best_move</a>&nbsp;&nbsp;
97 <a href="#M000006">new</a>&nbsp;&nbsp;
98 <a href="#M000008">score_position</a>&nbsp;&nbsp;
99 <a href="#M000009">to_bitstring</a>&nbsp;&nbsp;
100 <a href="#M000010">to_genome</a>&nbsp;&nbsp;
101 </div>
102 </div>
103
104 </div>
105
106
107 <!-- if includes -->
108
109 <div id="section">
110
111
112
113
114
115 <div id="attribute-list">
116 <h3 class="section-bar">Attributes</h3>
117
118 <div class="name-list">
119 <table>
120 <tr class="top-aligned-row context-row">
121 <td class="context-item-name">base_pull</td>
122 <td class="context-item-value">&nbsp;[R]&nbsp;</td>
123 <td class="context-item-desc"></td>
124 </tr>
125 <tr class="top-aligned-row context-row">
126 <td class="context-item-name">capture_bonus</td>
127 <td class="context-item-value">&nbsp;[R]&nbsp;</td>
128 <td class="context-item-desc"></td>
129 </tr>
130 <tr class="top-aligned-row context-row">
131 <td class="context-item-name">enemy_pull</td>
132 <td class="context-item-value">&nbsp;[R]&nbsp;</td>
133 <td class="context-item-desc"></td>
134 </tr>
135 <tr class="top-aligned-row context-row">
136 <td class="context-item-name">friend_pull</td>
137 <td class="context-item-value">&nbsp;[R]&nbsp;</td>
138 <td class="context-item-desc"></td>
139 </tr>
140 <tr class="top-aligned-row context-row">
141 <td class="context-item-name">safe_bonus</td>
142 <td class="context-item-value">&nbsp;[R]&nbsp;</td>
143 <td class="context-item-desc"></td>
144 </tr>
145 </table>
146 </div>
147 </div>
148
149
150
151 <!-- if method_list -->
152 <div id="methods">
153 <h3 class="section-bar">Public Class methods</h3>
154
155 <div id="method-M000006" class="method-detail">
156 <a name="M000006"></a>
157
158 <div class="method-heading">
159 <a href="Potential_player.src/M000006.html" target="Code" class="method-signature"
160 onclick="popupCode('Potential_player.src/M000006.html');return false;">
161 <span class="method-name">new</span><span class="method-args">(args, verbose = false)</span>
162 </a>
163 </div>
164
165 <div class="method-description">
166 </div>
167 </div>
168
169 <h3 class="section-bar">Public Instance methods</h3>
170
171 <div id="method-M000007" class="method-detail">
172 <a name="M000007"></a>
173
174 <div class="method-heading">
175 <a href="Potential_player.src/M000007.html" target="Code" class="method-signature"
176 onclick="popupCode('Potential_player.src/M000007.html');return false;">
177 <span class="method-name">best_move</span><span class="method-args">(game, die_result)</span>
178 </a>
179 </div>
180
181 <div class="method-description">
182 <p>
183 Find the best move of the possible ones
184 </p>
185 </div>
186 </div>
187
188 <div id="method-M000008" class="method-detail">
189 <a name="M000008"></a>
190
191 <div class="method-heading">
192 <a href="Potential_player.src/M000008.html" target="Code" class="method-signature"
193 onclick="popupCode('Potential_player.src/M000008.html');return false;">
194 <span class="method-name">score_position</span><span class="method-args">(game, player)</span>
195 </a>
196 </div>
197
198 <div class="method-description">
199 <p>
200 Calculate the potential score of a position for a given player
201 </p>
202 </div>
203 </div>
204
205 <div id="method-M000009" class="method-detail">
206 <a name="M000009"></a>
207
208 <div class="method-heading">
209 <a href="Potential_player.src/M000009.html" target="Code" class="method-signature"
210 onclick="popupCode('Potential_player.src/M000009.html');return false;">
211 <span class="method-name">to_bitstring</span><span class="method-args">()</span>
212 </a>
213 </div>
214
215 <div class="method-description">
216 <p>
217 Convert a player to a bitstring
218 </p>
219 </div>
220 </div>
221
222 <div id="method-M000010" class="method-detail">
223 <a name="M000010"></a>
224
225 <div class="method-heading">
226 <a href="Potential_player.src/M000010.html" target="Code" class="method-signature"
227 onclick="popupCode('Potential_player.src/M000010.html');return false;">
228 <span class="method-name">to_genome</span><span class="method-args">()</span>
229 </a>
230 </div>
231
232 <div class="method-description">
233 <p>
234 Convert a player to a genome
235 </p>
236 </div>
237 </div>
238
239
240 </div>
241
242
243 </div>
244
245
246 <div id="validator-badges">
247 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
248 </div>
249
250 </body>
251 </html>