-
Notifications
You must be signed in to change notification settings - Fork 0
/
player_control.html
87 lines (69 loc) · 6.16 KB
/
player_control.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module player_control</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>player_control</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/knezi/Documents/bergen/zapocet/src/player_control.py">/home/knezi/Documents/bergen/zapocet/src/player_control.py</a></font></td></tr></table>
<p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="builtins.html#object">builtins.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="player_control.html#PlayerControl">PlayerControl</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="PlayerControl">class <strong>PlayerControl</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>interface for controlling ants and getting current state of the game<br>
this class can be accessed through self.<strong>_pc</strong> in children of PlayerInstance<br>
for examples see players/*<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="PlayerControl-__init__"><strong>__init__</strong></a>(self, no, game)</dt><dd><tt>no - number of this player<br>
game - instance of game <a href="builtins.html#object">object</a> for accessing the game</tt></dd></dl>
<dl><dt><a name="PlayerControl-get_ants"><strong>get_ants</strong></a>(self)</dt><dd><tt>return a BoxContainer containing both own and enemious ants</tt></dd></dl>
<dl><dt><a name="PlayerControl-get_height"><strong>get_height</strong></a>(self)</dt><dd><tt>return a height of the arena</tt></dd></dl>
<dl><dt><a name="PlayerControl-get_iteration"><strong>get_iteration</strong></a>(self)</dt><dd><tt>return the number of current iteration (numbered from 1)</tt></dd></dl>
<dl><dt><a name="PlayerControl-get_nest"><strong>get_nest</strong></a>(self)</dt><dd><tt>return a tuple (x,y) of coordinates of the nest</tt></dd></dl>
<dl><dt><a name="PlayerControl-get_player"><strong>get_player</strong></a>(self)</dt><dd><tt>return number of this player</tt></dd></dl>
<dl><dt><a name="PlayerControl-get_square"><strong>get_square</strong></a>(self, x, y)</dt><dd><tt>return number of what is at coordinates (x,y):<br>
-1 wall<br>
0 nothin<br>
1... ant belonging to player whose number it is</tt></dd></dl>
<dl><dt><a name="PlayerControl-get_timeout"><strong>get_timeout</strong></a>(self)</dt><dd><tt>return a time available for one iteration</tt></dd></dl>
<dl><dt><a name="PlayerControl-get_walls"><strong>get_walls</strong></a>(self)</dt><dd><tt>return a BoxContainer containing all walls</tt></dd></dl>
<dl><dt><a name="PlayerControl-get_width"><strong>get_width</strong></a>(self)</dt><dd><tt>return a width of the arena</tt></dd></dl>
<dl><dt><a name="PlayerControl-last_kills"><strong>last_kills</strong></a>(self)</dt><dd><tt>return a boxcontainer containing positions of all ants that has been killed in the last iteration</tt></dd></dl>
<dl><dt><a name="PlayerControl-last_moves"><strong>last_moves</strong></a>(self)</dt><dd><tt>return a BoxContainer containing all ants that has been moved in the last iteration in the format:<br>
for an ant that has moved from (x,y) to (xn,yn) the box contains a tuple (xn,yn) on the (x,y) position</tt></dd></dl>
<dl><dt><a name="PlayerControl-move"><strong>move</strong></a>(self, x, y, x_new, y_new)</dt><dd><tt>move an ant at (x,y) to (x_new, y_new)<br>
it is only possible to change exactly one of the coordinates by exactly one;<br>
of course it is possible to move only player's own<br>
if the move is not permitted, nothing happens</tt></dd></dl>
<dl><dt><a name="PlayerControl-no_iterations"><strong>no_iterations</strong></a>(self)</dt><dd><tt>return number of iterations in the game j</tt></dd></dl>
<dl><dt><a name="PlayerControl-no_players"><strong>no_players</strong></a>(self)</dt><dd><tt>return number of this player</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table>
</body></html>