aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/goal__path_8cpp-source.html
blob: 4106ff680a2d1fdeb21a1556c6bfff389a09c77b (plain)
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
	<TITLE>nevrax.org : docs</TITLE>
	<LINK REL=stylesheet TYPE="text/css" HREF="/inc/css/nevrax.css">
	<link href="doxygen.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY MARGINHEIGHT="0" MARGINWIDTH="0">

<!-- uplinks -->
<TABLE CELLSPACING=0 CELLPADDING=0  BORDER=0>
 <TR>
        <TD WIDTH=16><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
        <TD WIDTH=140 BGCOLOR=#dddddd><IMG  SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD>
        <TD WIDTH=16><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
        <TD><IMG width=6 height=14 SRC="/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF='/'><b>Home</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
        <TD><IMG  width=6 height=14  SRC="/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF='/'><b>nevrax.com</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
 </TR>
</TABLE> 

<!-- banner Nevrax -->
<TABLE CELLSPACING=0 CELLPADDING=0  BORDER=0 WIDTH=100%>
 <TR><TD  BGCOLOR="#000000" BACKGROUND="/inc/img/black_banner.jpg"><A HREF=""><IMG  SRC="/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR>
</TABLE>

<!-- main table -->
<TABLE CELLSPACING=0 CELLPADDING=0  BORDER=0 height=100%>
 <TR>
	<TD WIDTH=16><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD>
	<TD WIDTH=140   BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG  SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">

		<!------ Begin Box ------>
		<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0  cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black>
		<FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td  colspan=2 bgcolor=#FFFFFF>
		<TABLE cellspacing=0 cellpadding=1 border=0>
			<tr><td ALIGN=middle><a  class='linkbox' href="/news/" TITLE="Rubrique news"><img width=13 height=15  hspace=5 border=0 src=/inc/img/picto-news.gif ALT=#></A></td><td><a  class='linkbox' href="/news/" TITLE="News">News</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/mail/" TITLE="Rubrique mail"><img width=15 height=11  hspace=5 border=0 src=/inc/img/picto-mail.gif ALT=#></A></td><td><a  class='linkbox' href="/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/docs/" TITLE="Rubrique docs"><img width=14 height=16  hspace=5 border=0 src=/inc/img/picto-docs.gif ALT=#></A></td><td><a  class='linkbox' href="/docs/" TITLE="Documentation">Documentation</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/cvs/" TITLE="Rubrique cvs"><img width=13 height=17  hspace=5 border=0 src=/inc/img/picto-cvs.gif ALT=#></A></td><td><a  class='linkbox' href="/cvs/" TITLE="CVS Web">CVS</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/bugs/" TITLE="Rubrique bugs"><img width=20 height=16  hspace=5 border=0 src=/inc/img/picto-bugs.gif ALT=#></A></td><td><a  class='linkbox' href="/bugs/" TITLE="Bugtracking">Bugs</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/GPL.php3" TITLE="Rubrique license"><img  width=18 height=12   hspace=5 border=0 src=/inc/img/picto-gpl.gif ALT=#></A></td><td><a  class='linkbox' href="/GPL.php3" TITLE="License">License</a></td></tr>
		</TABLE>
		</TD></TR></TABLE></TD></TR></TABLE>
		<!------ End Box  ------>

	</TD>
	<TD WIDTH=15><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
	<TD ALIGN=left valign=top><IMG  SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">

<!-- title -->
<TABLE  background="/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0  BORDER=0 width=100%><tr><td>
<A HREF="/docs/"><img src="/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A>
</td><td><IMG  SRC="/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT="">
</td></tr></table>
&nbsp;

<!-- block -->
<TABLE  bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0  BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="/inc/img/reddots.gif"></TD>
	<TD><B>Documentation</B></TD>
	<TD ALIGN=RIGHT>&nbsp;</td>
</tr></table>
<!-- Generated by Doxygen 1.2.14 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</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="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; <a class="qindexRef" doxygen="_cgi:/cgi-bin/nel-search.cgi" href="/cgi-bin/nel-search.cgi">Search</a> &nbsp; </center>
<hr><h1>goal_path.cpp</h1><a href="goal__path_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 
00006 <font class="comment">/* Copyright, 2000 Nevrax Ltd.</font>
00007 <font class="comment"> *</font>
00008 <font class="comment"> * This file is part of NEVRAX NEL.</font>
00009 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font>
00010 <font class="comment"> * it under the terms of the GNU General Public License as published by</font>
00011 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font>
00012 <font class="comment"> * any later version.</font>
00013 <font class="comment"></font>
00014 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font>
00015 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font>
00016 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font>
00017 <font class="comment"> * General Public License for more details.</font>
00018 <font class="comment"></font>
00019 <font class="comment"> * You should have received a copy of the GNU General Public License</font>
00020 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font>
00021 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font>
00022 <font class="comment"> * MA 02111-1307, USA.</font>
00023 <font class="comment"> */</font>
00024 <font class="preprocessor">#include "<a class="code" href="goal__path_8h.html">nel/ai/logic/goal_path.h</a>"</font>
00025 <font class="preprocessor">#include "<a class="code" href="object__type_8h.html">nel/ai/agent/object_type.h</a>"</font>
00026 <font class="preprocessor">#include "<a class="code" href="msg__goal_8h.html">nel/ai/agent/msg_goal.h</a>"</font>
00027 
00028 
00029 <font class="keyword">namespace </font>NLAILOGIC
00030 {
<a name="l00031"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a0">00031</a>         CGoalPath::CGoalPath(<a class="code" href="classNLAIAGENT_1_1IAgentManager.html">NLAIAGENT::IAgentManager</a> *manager) : CActorScript( manager, true )
00032         {
00033         }
00034 
<a name="l00035"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a1">00035</a>         CGoalPath::CGoalPath(<a class="code" href="classNLAIAGENT_1_1IAgentManager.html">NLAIAGENT::IAgentManager</a> *manager, 
00036                                                         <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html">NLAIAGENT::IBasicAgent</a> *father,
00037                                                            <a class="code" href="classstd_1_1list.html">std::list&lt;NLAIAGENT::IObjectIA *&gt;</a> &amp;<a class="code" href="driver__opengl__extension__def_8h.html#a413">components</a>,       
00038                                                            <a class="code" href="classNLAISCRIPT_1_1CAgentClass.html">NLAISCRIPT::CAgentClass</a> *actor_class )
00039         : CActorScript(manager, father, components, actor_class )
00040         {       
00041         }       
00042 
00043 
<a name="l00044"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a3">00044</a>         <font class="keywordtype">void</font> CGoalPath::addGoal( CGoal *goal, <font class="keywordtype">bool</font> action, <font class="keywordtype">int</font> on_success, <font class="keywordtype">int</font> on_failure )
00045         {
00046                 <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o0">_Goals</a>.push_back( goal );
00047                 <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o3">_JmpNext</a>.push_back( action );
00048                 <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o1">_OnSucces</a>.push_back( on_success );
00049                 <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o2">_OnFailure</a>.push_back( on_failure );
00050         }
00051 
<a name="l00052"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a7">00052</a>         <font class="keywordtype">void</font> CGoalPath::success()
00053         {
00054                 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o4">_CurrentState</a> &lt; ( int(<a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o0">_Goals</a>.size()) - 1 ) )
00055                 {
00056                         <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o4">_CurrentState</a>++;
00057                         <a class="code" href="classNLAIAGENT_1_1IMessageBase.html">NLAIAGENT::IMessageBase</a> *msg = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CGoalMsg.html">NLAIAGENT::CGoalMsg</a>((<a class="code" href="classNLAIAGENT_1_1IBasicAgent.html">NLAIAGENT::IBasicAgent</a> *)NULL);
00058                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#a9">setPerformatif</a>(<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#s10s2">NLAIAGENT::IMessageBase::PAchieve</a>);
00059                         CGoal *g = <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o0">_Goals</a>[ <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o4">_CurrentState</a> ];
00060                         g-&gt;setSender( <font class="keyword">this</font> );
00061                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IListBasicManager.html#z161_4">set</a>(0, g );
00062                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#z165_0">setSender</a>( <font class="keyword">this</font> );
00063                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#z165_1">setReceiver</a>( <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o6">_Father</a>);
00064                         <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o6">_Father</a>-&gt;<a class="code" href="classNLAIAGENT_1_1CProxyAgentMail.html#z141_6">sendMessage</a>(msg);
00065                 }
00066                 <font class="keywordflow">else</font>
00067                 {
00068                         <font class="comment">// Sends the launcher a succes, then dies</font>
00069                         CActorScript::success();
00070                 }
00071         }
00072 
<a name="l00073"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a8">00073</a>         <font class="keywordtype">void</font> CGoalPath::failure()
00074         {
00075                 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o4">_CurrentState</a> &lt; ( int(<a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o0">_Goals</a>.size()) - 1 ) )
00076                 {
00077                         <font class="comment">// Relaunches </font>
00078                         <a class="code" href="classNLAIAGENT_1_1IMessageBase.html">NLAIAGENT::IMessageBase</a> *msg = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CGoalMsg.html">NLAIAGENT::CGoalMsg</a>((<a class="code" href="classNLAIAGENT_1_1IBasicAgent.html">NLAIAGENT::IBasicAgent</a> *)NULL);
00079                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#a9">setPerformatif</a>(<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#s10s2">NLAIAGENT::IMessageBase::PAchieve</a>);
00080                         CGoal *g = <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o0">_Goals</a>[ <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o4">_CurrentState</a> ];
00081                         g-&gt;setSender( <font class="keyword">this</font> );
00082                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IListBasicManager.html#z161_4">set</a>(0, g );
00083                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#z165_0">setSender</a>( <font class="keyword">this</font> );
00084                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#z165_1">setReceiver</a>( <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o6">_Father</a>);
00085                         <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o6">_Father</a>-&gt;<a class="code" href="classNLAIAGENT_1_1CProxyAgentMail.html#z141_6">sendMessage</a>(msg);
00086 
00087                 }
00088                 <font class="keywordflow">else</font>
00089                 {
00090                         <font class="comment">// Sends the launcher a failure, then dies</font>
00091                         CActorScript::failure();
00092                 }
00093         }
00094 
00095 
00096 <font class="comment">//      sint32 getMethodIndexSize() const;</font>
00097 <font class="comment">//      virtual tQueue getPrivateMember(const IVarName *,const IVarName *,const IObjectIA &amp;) const;</font>
00098 <font class="comment">//      virtual IObjectIA::CProcessResult runMethodBase(int heritance, int index,IObjectIA *);</font>
00099 <font class="comment">//      virtual IObjectIA::CProcessResult runMethodBase(int index,IObjectIA *);</font>
00100 
00101 
<a name="l00102"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a11">00102</a>         NLAIAGENT::tQueue CGoalPath::getPrivateMember(<font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IVarName.html">NLAIAGENT::IVarName</a> *className,<font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IVarName.html">NLAIAGENT::IVarName</a> *funcName,<font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IObjectIA.html">NLAIAGENT::IObjectIA</a> &amp;<a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>)<font class="keyword"> const</font>
00103 <font class="keyword">        </font>{
00104 
00105 <font class="preprocessor">#ifdef NL_DEBUG </font>
00106 <font class="preprocessor"></font>        std::string nameP;
00107         std::string nameM;
00108         funcName-&gt;<a class="code" href="classNLAIC_1_1IBasicType.html#a5">getDebugString</a>(nameM);
00109         params.<a class="code" href="classNLAIC_1_1IBasicType.html#a5">getDebugString</a>(nameP);
00110         <font class="keyword">const</font> <font class="keywordtype">char</font> *dbg_class_name = (<font class="keyword">const</font> <font class="keywordtype">char</font> *) <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a16">getType</a>();
00111 <font class="preprocessor">#endif</font>
00112 <font class="preprocessor"></font>                <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> constructor_name(<font class="stringliteral">"Constructor"</font>);
00113                 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> add_goal_name(<font class="stringliteral">"AddGoal"</font>);
00114 
00115                 NLAIAGENT::tQueue <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00116                 <font class="keywordflow">if</font>(className == NULL)
00117                 {
00118                         <font class="keywordflow">if</font>( (*funcName) == constructor_name )
00119                         {                                       
00120                                 <a class="code" href="classNLAIAGENT_1_1CObjectType.html">NLAIAGENT::CObjectType</a> *c = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CObjectType.html">NLAIAGENT::CObjectType</a>( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( CGoal::IdGoal ) );                                       
00121                                 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( 0 + CActorScript::getMethodIndexSize(), 0.0, NULL, c) );                                  
00122                         }
00123 
00124                         <font class="keywordflow">if</font>( (*funcName) == add_goal_name )
00125                         {                                       
00126                                 <a class="code" href="classNLAIAGENT_1_1CObjectType.html">NLAIAGENT::CObjectType</a> *c = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CObjectType.html">NLAIAGENT::CObjectType</a>( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( CGoal::IdGoal ) );                                       
00127                                 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( 1 + CActorScript::getMethodIndexSize(), 0.0, NULL, c) );                                  
00128                         }
00129                 }
00130 
00131                 <font class="keywordflow">if</font> ( <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.empty() )
00132                         <font class="keywordflow">return</font> CActorScript::getPrivateMember(className, funcName, params);
00133                 <font class="keywordflow">else</font>
00134                         <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00135         }
00136 
00137 
<a name="l00138"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a12">00138</a>         <a class="code" href="structNLAIAGENT_1_1IObjectIA_1_1CProcessResult.html">NLAIAGENT::IObjectIA::CProcessResult</a> CGoalPath::runMethodBase(<font class="keywordtype">int</font> heritance, <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>, <a class="code" href="classNLAIAGENT_1_1IObjectIA.html">NLAIAGENT::IObjectIA</a> *)
00139         {
00140                 <font class="keywordflow">return</font> IObjectIA::CProcessResult();
00141         }
00142 
<a name="l00143"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a13">00143</a>         <a class="code" href="structNLAIAGENT_1_1IObjectIA_1_1CProcessResult.html">NLAIAGENT::IObjectIA::CProcessResult</a> CGoalPath::runMethodBase(<font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>, <a class="code" href="classNLAIAGENT_1_1IObjectIA.html">NLAIAGENT::IObjectIA</a> *p)
00144         {
00145                 <a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *<a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a> = (<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *)p;
00146 
00147                 <font class="keywordflow">switch</font>(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> - CActorScript::getMethodIndexSize())
00148                 {
00149                         <font class="keywordflow">case</font> 0:
00150                                 {                                       
00151 <font class="preprocessor">#ifdef NL_DEBUG</font>
00152 <font class="preprocessor"></font>                                        <font class="comment">//const char *dbg_name = name-&gt;getStr().getString();</font>
00153 <font class="preprocessor">#endif</font>
00154 <font class="preprocessor"></font>                                        <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o6">_Father</a> = (<a class="code" href="classNLAIAGENT_1_1CProxyAgentMail.html">NLAIAGENT::CProxyAgentMail</a> *) param-&gt;<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_11">getFront</a>();
00155                                         param-&gt;<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_9">popFront</a>();
00156                                         <font class="comment">// If the constructor() function is explicitely called and the object has already been initialised</font>
00157                                         <font class="keywordflow">while</font> ( param-&gt;<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_12">size</a>() )
00158                                         {
00159                                                 <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o0">_Goals</a>.push_back( (<a class="code" href="classNLAILOGIC_1_1CGoal.html">NLAILOGIC::CGoal</a> *) param-&gt;<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_11">getFront</a>()-&gt;clone() );
00160                                                 param-&gt;<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_9">popFront</a>();
00161                                         }
00162                                         <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o4">_CurrentState</a> = 0;
00163                                         <font class="keywordflow">return</font> IObjectIA::CProcessResult();
00164                                 } 
00165                                 <font class="keywordflow">break</font>;
00166 
00167                         <font class="keywordflow">case</font> 1:
00168                                 {                                       
00169                                         <font class="comment">// If the constructor() function is explicitely called and the object has already been initialised</font>
00170                                         <font class="keywordflow">while</font> ( param-&gt;<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_12">size</a>() )
00171                                         {
00172                                                 <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o0">_Goals</a>.push_back( (<a class="code" href="classNLAILOGIC_1_1CGoal.html">NLAILOGIC::CGoal</a> *) param-&gt;<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_11">getFront</a>()-&gt;clone() );
00173                                                 param-&gt;<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_9">popFront</a>();
00174                                         }
00175                                         <font class="keywordflow">return</font> IObjectIA::CProcessResult();
00176                                 } 
00177                                 <font class="keywordflow">break</font>;
00178 
00179                 }
00180 
00181                 <font class="keywordflow">return</font> CActorScript::runMethodBase( <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>, p );
00182         }
00183 
<a name="l00184"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a10">00184</a>         sint32 CGoalPath::getMethodIndexSize()<font class="keyword"> const</font>
00185 <font class="keyword">        </font>{
00186                 <font class="keywordflow">return</font> CActorScript::getMethodIndexSize() + 2;
00187         }
00188 
<a name="l00189"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a14">00189</a>         <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CGoalPath::clone()<font class="keyword"> const</font>
00190 <font class="keyword">        </font>{
00191                 <a class="code" href="classNLAIC_1_1IBasicInterface.html">NLAIC::IBasicInterface</a> *m = <font class="keyword">new</font> <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a0">CGoalPath</a>( *<font class="keyword">this</font> );
00192                 <font class="keywordflow">return</font> m;
00193         }
00194 
<a name="l00195"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a15">00195</a>         <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CGoalPath::newInstance()<font class="keyword"> const</font>
00196 <font class="keyword">        </font>{
00197                 <font class="keywordflow">return</font> <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a14">clone</a>();
00198         }
00199 
<a name="l00200"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a16">00200</a>         <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> &amp;CGoalPath::getType()<font class="keyword"> const</font>
00201 <font class="keyword">        </font>{
00202                 <font class="keywordflow">return</font> <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#p0">IdGoalPath</a>;
00203         }
00204 
<a name="l00205"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a9">00205</a>         <font class="keywordtype">int</font> CGoalPath::getBaseMethodCount()<font class="keyword"> const</font>
00206 <font class="keyword">        </font>{
00207                 <font class="keywordflow">return</font> CActorScript::getBaseMethodCount() + 2;
00208         }
00209 <font class="comment">/*</font>
00210 <font class="comment">        void CGoalPath::onPause()</font>
00211 <font class="comment">        {</font>
00212 <font class="comment">                if ( _Father != NULL )</font>
00213 <font class="comment">                {</font>
00214 <font class="comment">                        NLAIAGENT::IMessageBase *msg = new NLAIAGENT::CCancelGoalMsg((NLAIAGENT::IBasicAgent *)NULL);</font>
00215 <font class="comment">                        msg-&gt;setPerformatif(NLAIAGENT::IMessageBase::PAchieve);</font>
00216 <font class="comment">                        msg-&gt;set(0, _Goals[ _CurrentState ] );</font>
00217 <font class="comment">                        msg-&gt;setSender( this );</font>
00218 <font class="comment">                        msg-&gt;setReceiver( _Father);</font>
00219 <font class="comment">                        _Father-&gt;sendMessage(msg);</font>
00220 <font class="comment">                }</font>
00221 <font class="comment">        }</font>
00222 <font class="comment"></font>
00223 <font class="comment">        void CGoalPath::onRestart()</font>
00224 <font class="comment">        {</font>
00225 <font class="comment">                if ( _Father != NULL )</font>
00226 <font class="comment">                {</font>
00227 <font class="comment">                        NLAIAGENT::IMessageBase *msg = new NLAIAGENT::CGoalMsg((NLAIAGENT::IBasicAgent *)NULL);</font>
00228 <font class="comment">                        msg-&gt;setPerformatif(NLAIAGENT::IMessageBase::PAchieve);</font>
00229 <font class="comment">                        msg-&gt;set(0, _Goals[ _CurrentState ] );</font>
00230 <font class="comment">                        msg-&gt;setSender( this );</font>
00231 <font class="comment">                        msg-&gt;setReceiver( _Father);</font>
00232 <font class="comment">                        _Father-&gt;sendMessage(msg);</font>
00233 <font class="comment">                }</font>
00234 <font class="comment">        }</font>
00235 <font class="comment">*/</font>
00236 
<a name="l00237"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a5">00237</a>         <font class="keywordtype">void</font> CGoalPath::onActivate()
00238         {
00239                 <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o4">_CurrentState</a> = 0;
00240                 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o6">_Father</a> != NULL )
00241                 {
00242                         <a class="code" href="classNLAIAGENT_1_1IMessageBase.html">NLAIAGENT::IMessageBase</a> *msg = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CGoalMsg.html">NLAIAGENT::CGoalMsg</a>((<a class="code" href="classNLAIAGENT_1_1IBasicAgent.html">NLAIAGENT::IBasicAgent</a> *)NULL);
00243                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#a9">setPerformatif</a>(<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#s10s2">NLAIAGENT::IMessageBase::PAchieve</a>);
00244                         CGoal *g = <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o0">_Goals</a>[ <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o4">_CurrentState</a> ];
00245                         g-&gt;setSender( <font class="keyword">this</font> );
00246                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IListBasicManager.html#z161_4">set</a>(0, g );
00247                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#z165_0">setSender</a>( <font class="keyword">this</font> );
00248                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#z165_1">setReceiver</a>( <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o6">_Father</a>);
00249                         <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o6">_Father</a>-&gt;<a class="code" href="classNLAIAGENT_1_1CProxyAgentMail.html#z141_6">sendMessage</a>(msg);
00250                 }
00251         }
00252 
<a name="l00253"></a><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a6">00253</a>         <font class="keywordtype">void</font> CGoalPath::onUnActivate()
00254         {
00255                 <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o4">_CurrentState</a> = 0;
00256                 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o6">_Father</a> != NULL )
00257                 {
00258                         <a class="code" href="classNLAIAGENT_1_1IMessageBase.html">NLAIAGENT::IMessageBase</a> *msg = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CCancelGoalMsg.html">NLAIAGENT::CCancelGoalMsg</a>((<a class="code" href="classNLAIAGENT_1_1IBasicAgent.html">NLAIAGENT::IBasicAgent</a> *)NULL);
00259                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#a9">setPerformatif</a>(<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#s10s2">NLAIAGENT::IMessageBase::PAchieve</a>);
00260                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IListBasicManager.html#z161_4">set</a>(0, <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o0">_Goals</a>[ <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o4">_CurrentState</a> ] );
00261                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#z165_0">setSender</a>( <font class="keyword">this</font> );
00262                         msg-&gt;<a class="code" href="classNLAIAGENT_1_1IMessageBase.html#z165_1">setReceiver</a>( <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o6">_Father</a>);
00263                         <a class="code" href="classNLAILOGIC_1_1CGoalPath.html#o6">_Father</a>-&gt;<a class="code" href="classNLAIAGENT_1_1CProxyAgentMail.html#z141_6">sendMessage</a>(msg);
00264                 }
00265         }
00266 } <font class="comment">// NLAILOGIC</font>
</pre></div>

<!-- footer -->
<BR><FONT Size=+5>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </FONT>
</TD>
<TD WIDTH=15><IMG  SRC=/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD>
</TR>
</TABLE>
</BODY>
</HTML>