-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathActorList.html
221 lines (177 loc) · 7.7 KB
/
ActorList.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ActorList - List of actors : OpenKore source code documentation</title>
<link rel="stylesheet" type="text/css" href="openkore.css">
<link rel="stylesheet" type="text/css" href="highlight.css">
<!-- Fix broken PNG transparency for IE/Win5-6+ -->
<!--[if gte IE 5.5000]>
<script type="text/javascript" src="pngfix.js"></script>
<![endif]-->
</head>
<body>
<div id="title">OpenKore source code documentation</div>
<div id="navigation">
<ul>
<li><a href="http://www.openkore.com/">Main website</a></li>
<li><a href="index.html">Table of contents</a></li>
<li><b>ActorList</b></li>
</ul>
</div>
<div id="main">
<h1>ActorList - List of actors</h1>
<b>Derived from: <a href="Utils--ObjectList.html">ObjectList</a></b>
<p>
The ActorList class holds a list of Actor-objects.
OpenKore stores lists of players/monsters/portals/NPCs/etc. in lists
of this type. Those lists are <code>$playersList</code>, <code>$monstersList</code>, <code>$npcsList</code>,
<code>$petsList</code> and <code>$portalsList</code>, defined in Globals.pm.
<p>
<h3>Differences compared to ObjectList</h3>
All items in ActorList are of the same class, and are all a
subclass of <a href="Actor.html">Actor</a>.
<p><table class="functionIndex">
<tr><th colspan="3">Class ActorList</th></tr><tr onclick="location.href='#ActorList->new';">
<td class="return-type"><a href="ActorList.html">ActorList</a></td>
<td class="func"><a href="#ActorList->new">ActorList->new</a></td>
<td class="decl">(<span class="type">String</span> type)</td>
</tr><tr onclick="location.href='#$ActorList->add';">
<td class="return-type">int</td>
<td class="func"><a href="#$ActorList->add">$ActorList->add</a></td>
<td class="decl">(<span class="type"><a href="Actor.html">Actor</a></span> actor)</td>
</tr><tr onclick="location.href='#$ActorList->getByID';">
<td class="return-type"><a href="Actor.html">Actor</a></td>
<td class="func"><a href="#$ActorList->getByID">$ActorList->getByID</a></td>
<td class="decl">(<span class="type">Bytes</span> ID)</td>
</tr><tr onclick="location.href='#$ActorList->remove';">
<td class="return-type">boolean</td>
<td class="func"><a href="#$ActorList->remove">$ActorList->remove</a></td>
<td class="decl">(<span class="type"><a href="Actor.html">Actor</a></span> actor)</td>
</tr><tr onclick="location.href='#$ActorList->removeByID';">
<td class="return-type">boolean</td>
<td class="func"><a href="#$ActorList->removeByID">$ActorList->removeByID</a></td>
<td class="decl">(<span class="type">Bytes</span> ID)</td>
</tr>
</table>
<p><hr class="details_sep">
<h2>Details</h2>
<div class="details">
<p>
<div class="function"><a name="$ActorList->add"></a>
<h3>$ActorList->add</h3>
<dl>
<dt class="decl">
<span class="return-type"> int</span> <strong>$ActorList->add</strong>(<span class="type"><a href="Actor.html">Actor</a></span> actor)
</dt>
<dd>
<dl class="params_and_returns">
<dt class="requires"><strong>Requires:</strong></dt>
<dd class="requires"> defined($actor) defined($actor->{ID}) $self->find($actor) == -1</dd>
</dl><p>
<div class="desc">Adds an actor to this ActorList.
<p>
This method overloads <a href="Utils--ObjectList.html#$ObjectList->add"><code>$ObjectList->add()</code></a>, and has a stronger precondition.
See the documentation for that method for more information about this
method.</div>
</dd>
</dl>
</div>
<p><hr class="function_sep"><p>
<div class="function"><a name="$ActorList->getByID"></a>
<h3>$ActorList->getByID</h3>
<dl>
<dt class="decl">
<span class="return-type"> <a href="Actor.html">Actor</a></span> <strong>$ActorList->getByID</strong>(<span class="type">Bytes</span> ID)
</dt>
<dd>
<dl class="params_and_returns">
<dt class="requires"><strong>Requires:</strong></dt>
<dd class="requires">defined($ID)</dd>
<dt class="ensures"><strong>Ensures:</strong></dt>
<dd class="ensures">if defined(result): result->{ID} eq <code>$ID</code></dd>
<dt class="returns"><strong>Returns:</strong></dt>
<dd class="returns">An Actor, or undef if there is no actor with that ID in this list.</dd>
</dl><p>
<div class="desc">Looks up an Actor object based on the actor ID.
<p>
See also: <code>$Actor</code>->{ID}</div>
</dd>
</dl>
</div>
<p><hr class="function_sep"><p>
<div class="function"><a name="$ActorList->remove"></a>
<h3>$ActorList->remove</h3>
<dl>
<dt class="decl">
<span class="return-type"> boolean</span> <strong>$ActorList->remove</strong>(<span class="type"><a href="Actor.html">Actor</a></span> actor)
</dt>
<dd>
<dl class="params_and_returns">
<dt class="requires"><strong>Requires:</strong></dt>
<dd class="requires">defined($actor) && defined($actor->{ID})</dd>
</dl><p>
<div class="desc">Removes an actor from this ActorList.
<p>
This method overloads <a href="Utils--ObjectList.html#$ObjectList->remove"><code>$ObjectList->remove()</code></a>, and has a stronger precondition.
See the documentation for that method for more information about this
method.</div>
</dd>
</dl>
</div>
<p><hr class="function_sep"><p>
<div class="function"><a name="$ActorList->removeByID"></a>
<h3>$ActorList->removeByID</h3>
<dl>
<dt class="decl">
<span class="return-type"> boolean</span> <strong>$ActorList->removeByID</strong>(<span class="type">Bytes</span> ID)
</dt>
<dd>
<dl class="params_and_returns">
<dt class="params"><strong>Parameters:</strong></dt>
<dd class="param"><code>ID</code> : The ID of the actor to remove.</dd>
<dt class="requires"><strong>Requires:</strong></dt>
<dd class="requires">defined($ID)</dd>
<dt class="returns"><strong>Returns:</strong></dt>
<dd class="returns">Whether the actor with the specified ID was in the list.</dd>
</dl><p>
<div class="desc">Removes an actor based on the actor ID. This will trigger an onRemove event
before the actor is removed.
<p>
See also: <code>$Actor</code>->{ID}</div>
</dd>
</dl>
</div>
<p><hr class="function_sep"><p>
<div class="function"><a name="ActorList->new"></a>
<h3>ActorList->new</h3>
<dl>
<dt class="decl">
<span class="return-type"> <a href="ActorList.html">ActorList</a></span> <strong>ActorList->new</strong>(<span class="type">String</span> type)
</dt>
<dd>
<dl class="params_and_returns">
<dt class="params"><strong>Parameters:</strong></dt>
<dd class="param"><code>type</code> : The name of the class that all items in this ActorList must be.</dd>
<dt class="requires"><strong>Requires:</strong></dt>
<dd class="requires">defined($type) && UNIVERSAL::isa($type, "Actor")</dd>
<dt class="ensures"><strong>Ensures:</strong></dt>
<dd class="ensures"><code>$self->size()</code> == 0</dd>
</dl><p>
<div class="desc">Creates a new ActorList object.</div>
</dd>
</dl>
</div>
</div>
<p><hr><p>
<div id="footer">
<ul>
<li><a href="http://validator.w3.org/check?uri=referer" title="Valid HTML 4.01!"><img src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" height="31" width="88"></a></li>
<li><a href="http://www.mozilla.com/" title="Get Firefox - Take Back the Web"><img width="104" height="32" src="http://www.mozilla.org/products/firefox/buttons/getfirefox_small.png" alt="Get Firefox - Take Back the Web"></a></li>
<li><a href="http://www.mozilla.com/" title="If you were looking at this page in any browser but Microsoft Internet Explorer, it would look and run better and faster"><img width="45" height="45" src="http://linuxart.com/img/noIE-small.png" alt="If you were looking at this page in any browser but Microsoft Internet Explorer, it would look and run better and faster"></a></li>
</ul>
Last modified: Fri Nov 16 10:05:11 2012
</div>
</div>
</body>
</html>