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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
|
<!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="http://www.nevrax.org/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="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.org><b>Home</B></FONT></A> </TD>
<TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.com><b>nevrax.com</B></FONT></A> </TD>
</TR>
</TABLE>
<!-- banner Nevrax -->
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%>
<TR><TD BGCOLOR="#000000" BACKGROUND="http://www.nevrax.org/inc/img/black_banner.jpg"><A HREF="http://www.nevrax.org"><IMG SRC="http://www.nevrax.org/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="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD>
<TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="http://www.nevrax.org/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="http://www.nevrax.org/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="News">News</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Documentation">Documentation</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="CVS Web">CVS</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Bugtracking">Bugs</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="License">License</a></td></tr>
</TABLE>
</TD></TR></TABLE></TD></TR></TABLE>
<!------ End Box ------>
</TD>
<TD WIDTH=15><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD ALIGN=left valign=top><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">
<!-- title -->
<TABLE background="http://www.nevrax.org/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td>
<A HREF="http://www.nevrax.org/docs/"><img src="http://www.nevrax.org/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A>
</td><td><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT="">
</td></tr></table>
<!-- 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="http://www.nevrax.org/inc/img/reddots.gif"></TD>
<TD><B>Documentation</B></TD>
<TD ALIGN=RIGHT> </td>
</tr></table>
<!-- Generated by Doxygen 1.2.14 -->
<center>
<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> <a class="qindexRef" doxygen="_cgi:http://www.nevrax.org/cgi-bin/nel-search.cgi" href="http://www.nevrax.org/cgi-bin/nel-search.cgi">Search</a> </center>
<hr><h1>actor_script.cpp</h1><a href="actor__script_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001
00008 <font class="comment">/* Copyright, 2000 Nevrax Ltd.</font>
00009 <font class="comment"> *</font>
00010 <font class="comment"> * This file is part of NEVRAX NEL.</font>
00011 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font>
00012 <font class="comment"> * it under the terms of the GNU General Public License as published by</font>
00013 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font>
00014 <font class="comment"> * any later version.</font>
00015 <font class="comment"></font>
00016 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font>
00017 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font>
00018 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font>
00019 <font class="comment"> * General Public License for more details. </font>
00020 <font class="comment"></font>
00021 <font class="comment"> * You should have received a copy of the GNU General Public License</font>
00022 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font>
00023 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font>
00024 <font class="comment"> * MA 02111-1307, USA.</font>
00025 <font class="comment"> */</font>
00026
00027 <font class="preprocessor">#include "<a class="code" href="actor__script_8h.html">nel/ai/agent/actor_script.h</a>"</font>
00028 <font class="preprocessor">#include "<a class="code" href="agent__script_8h.html">nel/ai/agent/agent_script.h</a>"</font>
00029 <font class="preprocessor">#include "<a class="code" href="object__type_8h.html">nel/ai/agent/object_type.h</a>"</font>
00030 <font class="preprocessor">#include "<a class="code" href="codage_8h.html">nel/ai/script/codage.h</a>"</font>
00031 <font class="preprocessor">#include "<a class="code" href="interpret__object__agent_8h.html">nel/ai/script/interpret_object_agent.h</a>"</font>
00032 <font class="preprocessor">#include "<a class="code" href="interpret__fsm_8h.html">nel/ai/script/interpret_fsm.h</a>"</font>
00033 <font class="preprocessor">#include "<a class="code" href="fsm__seq__script_8h.html">nel/ai/logic/fsm_seq_script.h</a>"</font>
00034 <font class="preprocessor">#include "<a class="code" href="msg__action_8h.html">nel/ai/agent/msg_action.h</a>"</font>
00035 <font class="preprocessor">#include "<a class="code" href="interpret__message__action_8h.html">nel/ai/script/interpret_message_action.h</a>"</font>
00036 <font class="preprocessor">#include "<a class="code" href="goal__path_8h.html">nel/ai/logic/goal_path.h</a>"</font>
00037
00038 <font class="keyword">namespace </font>NLAIAGENT
00039 {
00040 <font class="keyword">static</font> CGroupType listBidon;
00041
00043 <font class="comment">// Succes and failure messages declaration</font>
00044
<a name="l00045"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#p0">00045</a> <a class="code" href="classNLAISCRIPT_1_1COperandSimpleListOr.html">NLAISCRIPT::COperandSimpleListOr</a> *CActorScript::ParamIdSuccessMsg = NULL;
<a name="l00046"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#p1">00046</a> <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a> *CActorScript::ParamSuccessMsg = NULL;
<a name="l00047"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#p2">00047</a> <a class="code" href="classNLAISCRIPT_1_1COperandSimpleListOr.html">NLAISCRIPT::COperandSimpleListOr</a> *CActorScript::ParamIdFailureMsg = NULL;
<a name="l00048"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#p3">00048</a> <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a> *CActorScript::ParamFailureMsg = NULL;
00049
<a name="l00050"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#d0">00050</a> <font class="keywordtype">void</font> CActorScript::initClass()
00051 {
00052 CActorScript::ParamIdSuccessMsg = <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1COperandSimpleListOr.html">NLAISCRIPT::COperandSimpleListOr</a>(2,
00053 <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(<a class="code" href="classNLAIAGENT_1_1CSuccessMsg.html#p0">NLAIAGENT::CSuccessMsg::IdSuccessMsg</a>),
00054 <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(<a class="code" href="classNLAISCRIPT_1_1CSuccessMsgClass.html#p0">NLAISCRIPT::CSuccessMsgClass::IdSuccessMsgClass</a>) );
00055 CActorScript::ParamSuccessMsg = <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a>(1,<a class="code" href="classNLAIAGENT_1_1CActorScript.html#p0">ParamIdSuccessMsg</a>);
00056 CActorScript::ParamIdFailureMsg = <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1COperandSimpleListOr.html">NLAISCRIPT::COperandSimpleListOr</a>(2,
00057 <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(<a class="code" href="classNLAIAGENT_1_1CFailureMsg.html#p0">NLAIAGENT::CFailureMsg::IdFailureMsg</a>),
00058 <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>(<a class="code" href="classNLAISCRIPT_1_1CFailureMsgClass.html#p0">NLAISCRIPT::CFailureMsgClass::IdFailureMsgClass</a>) );
00059
00060 CActorScript::ParamFailureMsg = <font class="keyword">new</font> <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a>(1,<a class="code" href="classNLAIAGENT_1_1CActorScript.html#p2">ParamIdFailureMsg</a>);
00061 }
00062
<a name="l00063"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#d1">00063</a> <font class="keywordtype">void</font> CActorScript::releaseClass()
00064 {
00065 CActorScript::ParamSuccessMsg-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a3">release</a>();
00066 CActorScript::ParamFailureMsg-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a3">release</a>();
00067 }
00069
00070
<a name="l00071"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a1">00071</a> CActorScript::CActorScript(<font class="keyword">const</font> CActorScript &a) : CAgentScript(a)
00072 {
00073 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n0">_IsActivated</a> = a._IsActivated;
00074 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n3">_OnActivateIndex</a> = a._OnActivateIndex;
00075 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n4">_OnUnActivateIndex</a> = a._OnUnActivateIndex;
00076 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n12">_TopLevel</a> = a._TopLevel;
00077 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n2">_IsPaused</a> = <font class="keyword">false</font>;
00078 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n9">_NbAnswers</a> = a._NbAnswers;
00079 }
00080
<a name="l00081"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a2">00081</a> CActorScript::CActorScript(IAgentManager *manager,
00082 IBasicAgent *father,
00083 <a class="code" href="classstd_1_1list.html">std::list<IObjectIA *></a> &<a class="code" href="driver__opengl__extension__def_8h.html#a413">components</a>,
00084 <a class="code" href="classNLAISCRIPT_1_1CAgentClass.html">NLAISCRIPT::CAgentClass</a> *actor_class )
00085 : CAgentScript(manager, father, components, actor_class )
00086 {
00087 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n0">_IsActivated</a> = <font class="keyword">false</font>;
00088 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n3">_OnActivateIndex</a> = -1;
00089 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n4">_OnUnActivateIndex</a> = -1;
00090 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n12">_TopLevel</a> = NULL;
00091 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n2">_IsPaused</a> = <font class="keyword">false</font>;
00092 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n9">_NbAnswers</a> = 1;
00093 }
00094
<a name="l00095"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">00095</a> CActorScript::CActorScript(IAgentManager *manager, <font class="keywordtype">bool</font> stay_alive) : CAgentScript( manager )
00096 {
00097 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n0">_IsActivated</a> = <font class="keyword">false</font>;
00098 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n3">_OnActivateIndex</a> = -1;
00099 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n4">_OnUnActivateIndex</a> = -1;
00100 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n12">_TopLevel</a> = NULL;
00101 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n2">_IsPaused</a> = <font class="keyword">false</font>;
00102 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n9">_NbAnswers</a> = 1;
00103 }
00104
<a name="l00105"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a3">00105</a> CActorScript::~CActorScript()
00106 {
00107 <font class="keywordflow">while</font> ( <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.size() )
00108 {
00109 <font class="preprocessor">#ifdef NL_DEBUG</font>
00110 <font class="preprocessor"></font> <a class="code" href="debug_8h.html#a1">nlinfo</a> (<font class="stringliteral">" _Launched 0x0%0x"</font>, <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.front());
00111 <font class="preprocessor">#endif</font>
00112 <font class="preprocessor"></font> <font class="comment">//_Launched.front()->setParent(NULL);</font>
00113 <font class="comment">//_Launched.front()->Kill();</font>
00114 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.front()->release();
00115 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.pop_front();
00116 }
00117 }
00118
<a name="l00120"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a4">00120</a> <font class="keywordtype">bool</font> CActorScript::isActivated()
00121 {
00122 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n0">_IsActivated</a>;
00123 }
00124
<a name="l00126"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a5">00126</a> <font class="keywordtype">void</font> CActorScript::activate()
00127 {
00128 <font class="keywordflow">if</font> ( !<a class="code" href="classNLAIAGENT_1_1CActorScript.html#n0">_IsActivated</a> )
00129 {
00130 <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#a1">CAgentScript</a> *father = (<a class="code" href="classNLAIAGENT_1_1CAgentScript.html#a1">CAgentScript</a> *) <a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a3">getParent</a>();
00131
00132 <font class="keywordflow">if</font> ( father && ( ( <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#a1">CAgentScript</a> *)father)->getClass()->isClassInheritedFrom( CStringVarName(<font class="stringliteral">"Fsm"</font>) ) != -1 )
00133 {
00134 ( (CFsmScript *)father)->activate( <font class="keyword">this</font> );
00135 }
00136
00137 <font class="comment">// Looks for the function to call at the activation of the state</font>
00138 <font class="keyword">static</font> CStringVarName activate_func_name(<font class="stringliteral">"OnActivate"</font>);
00139 <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n4">_AgentClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#z232_5">isMember</a>( NULL, &activate_func_name, <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a>() );
00140 <font class="keywordflow">if</font> ( !<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.empty() )
00141 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n3">_OnActivateIndex</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.top().Index;
00142 <font class="keywordflow">else</font>
00143 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a6">onActivate</a>();
00144 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n0">_IsActivated</a> = <font class="keyword">true</font>;
00145 }
00146 }
00147
<a name="l00149"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a7">00149</a> <font class="keywordtype">void</font> CActorScript::unActivate()
00150 {
00151 <font class="keywordflow">if</font> ( _IsActivated )
00152 {
00153 <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#a1">CAgentScript</a> *father = (<a class="code" href="classNLAIAGENT_1_1CAgentScript.html#a1">CAgentScript</a> *) <a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a3">getParent</a>();
00154 <font class="keywordflow">if</font> ( father && ( ( <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#a1">CAgentScript</a> *)father)->getClass()->isClassInheritedFrom( CStringVarName(<font class="stringliteral">"Fsm"</font>) ) != -1 )
00155 {
00156 ( (CFsmScript *)father)->unactivate( <font class="keyword">this</font> );
00157 }
00158
00159 <font class="keyword">static</font> CStringVarName unactivate_func_name(<font class="stringliteral">"OnUnActivate"</font>);
00160 <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n4">_AgentClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#z232_5">isMember</a>( NULL, &unactivate_func_name, <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a>() );
00161 <font class="keywordflow">if</font> ( !<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.empty() )
00162 {
00163 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n4">_OnUnActivateIndex</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.top().Index;
00164 <font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IAgentManager.html">NLAIAGENT::IAgentManager</a> *manager = <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z142_17">getAgentManager</a>();
00165 <font class="keywordflow">if</font> ( manager != NULL )
00166 {
00167 <a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> *context = (<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> *) manager-><a class="code" href="classNLAIAGENT_1_1IAgentManager.html#a3">getAgentContext</a>();
00168 context-><a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m3">Self</a> = <font class="keyword">this</font>;
00169 <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z144_23">runMethodeMember</a>( <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n4">_OnUnActivateIndex</a> ,context);
00170 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n3">_OnActivateIndex</a> = -1;
00171 }
00172 }
00173 <font class="comment">// Destroys launched childs?</font>
00174 <font class="keywordflow">while</font> ( <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.size() )
00175 {
00176 ( (<a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *) <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.front() )->cancel();
00177 <font class="comment">//_Launched.front()->Kill();</font>
00178 <font class="comment">/*if(_Launched.front()->getRef() >= 2)</font>
00179 <font class="comment"> _Launched.front()->release();*/</font>
00180 <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z142_6">removeDynamic</a>(<a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.front());
00181 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.front()->release();
00182 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.pop_front();
00183 }
00184 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a8">onUnActivate</a>();
00185 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n0">_IsActivated</a> = <font class="keyword">false</font>;
00186 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n2">_IsPaused</a> = <font class="keyword">false</font>;
00187 }
00188 }
00189
<a name="l00191"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a29">00191</a> <font class="keywordtype">void</font> CActorScript::pause()
00192 {
00193 <font class="keywordflow">if</font> ( _IsActivated )
00194 {
00195
00196 <font class="keywordflow">if</font> ( !<a class="code" href="classNLAIAGENT_1_1CActorScript.html#n2">_IsPaused</a> )
00197 {
00198 <font class="comment">// Looks for the function to call when the actor is paused</font>
00199 <font class="keyword">static</font> CStringVarName activate_func_name(<font class="stringliteral">"OnPause"</font>);
00200 <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n4">_AgentClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#z232_5">isMember</a>( NULL, &activate_func_name, <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a>() );
00201 <font class="keywordflow">if</font> ( !<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.empty() )
00202 {
00203 <font class="keywordflow">if</font> ( <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z142_17">getAgentManager</a>() != NULL )
00204 {
00205 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n5">_OnPauseIndex</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.top().Index;
00206 <a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> *context = (<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> *) <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z142_17">getAgentManager</a>()->getAgentContext();
00207 context-><a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m3">Self</a> = <font class="keyword">this</font>;
00208 <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z144_23">runMethodeMember</a>( <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n5">_OnPauseIndex</a> ,context);
00209 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n5">_OnPauseIndex</a> = -1;
00210 }
00211 }
00212 <font class="keywordflow">else</font>
00213 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a31">onPause</a>();
00214 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n2">_IsPaused</a> = <font class="keyword">true</font>;
00215 }
00216
00217 <font class="comment">// Calls the launched actors Pause callbacks</font>
00218 <a class="code" href="classstd_1_1list.html">std::list<IBasicAgent *></a>::iterator it_l = <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.begin();
00219 <font class="keywordflow">while</font> ( it_l != <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.end() )
00220 {
00221 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *launched = (<a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *) *it_l;
00222 launched->pause();
00223 it_l++;
00224 }
00225
00226 <font class="keywordtype">int</font> i;
00227 <font class="keywordflow">for</font> ( i = 0; i < <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n1">_NbComponents</a>; i++ )
00228 {
00229 <font class="keywordflow">if</font> ( ((<font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CTypeOfObject.html">NLAIC::CTypeOfObject</a> &)<a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n0">_Components</a>[i]->getType()) & <a class="code" href="classNLAIC_1_1CTypeOfObject.html#s12s8">NLAIC::CTypeOfObject::tActor</a> )
00230 {
00231 ( (<a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *) <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n0">_Components</a>[i] )->pause();
00232 }
00233 }
00234 }
00235 }
00236
<a name="l00237"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a31">00237</a> <font class="keywordtype">void</font> CActorScript::onPause()
00238 {
00239 <font class="comment">// Default: doesn't do anything.</font>
00240 }
00241
<a name="l00243"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a30">00243</a> <font class="keywordtype">void</font> CActorScript::restart()
00244 {
00245 <font class="keywordflow">if</font> ( _IsActivated )
00246 {
00247 <font class="keywordflow">if</font> ( _IsPaused )
00248 {
00249 <font class="comment">// Looks for the function to call when the actor is restarted</font>
00250 <font class="keyword">static</font> CStringVarName activate_func_name(<font class="stringliteral">"OnRestart"</font>);
00251 <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n4">_AgentClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#z232_5">isMember</a>( NULL, &activate_func_name, <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a>() );
00252 <font class="keywordflow">if</font> ( !<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.empty() )
00253 {
00254 <font class="keywordflow">if</font> ( <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z142_17">getAgentManager</a>() != NULL )
00255 {
00256 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n6">_OnRestartIndex</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.top().Index;
00257 <a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> *context = (<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> *) <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z142_17">getAgentManager</a>()->getAgentContext();
00258 context-><a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m3">Self</a> = <font class="keyword">this</font>;
00259 <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z144_23">runMethodeMember</a>( <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n6">_OnRestartIndex</a> ,context);
00260 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n6">_OnRestartIndex</a> = -1;
00261 }
00262 }
00263 <font class="keywordflow">else</font>
00264 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a32">onRestart</a>();
00265 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n2">_IsPaused</a> = <font class="keyword">false</font>;
00266 }
00267
00268 <font class="comment">// Calls the launched actors Restart callbacks</font>
00269 <a class="code" href="classstd_1_1list.html">std::list<IBasicAgent *></a>::iterator it_l = <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.begin();
00270 <font class="keywordflow">while</font> ( it_l != <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.end() )
00271 {
00272 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *launched = (<a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *) *it_l;
00273 launched->restart();
00274 it_l++;
00275 }
00276
00277 <font class="keywordtype">int</font> i;
00278 <font class="keywordflow">for</font> ( i = 0; i < <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n1">_NbComponents</a>; i++ )
00279 {
00280 <font class="keywordflow">if</font> ( ((<font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CTypeOfObject.html">NLAIC::CTypeOfObject</a> &)<a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n0">_Components</a>[i]->getType()) & <a class="code" href="classNLAIC_1_1CTypeOfObject.html#s12s8">NLAIC::CTypeOfObject::tActor</a> )
00281 {
00282 ( (<a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *) <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n0">_Components</a>[i] )->restart();
00283 }
00284 }
00285 }
00286 }
00287
<a name="l00288"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a32">00288</a> <font class="keywordtype">void</font> CActorScript::onRestart()
00289 {
00290 }
00291
<a name="l00295"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#b0">00295</a> <font class="keywordtype">void</font> CActorScript::switchActor(CActorScript *receiver, <font class="keywordtype">bool</font> stay_active)
00296 {
00297 receiver->activate();
00298
00299 <font class="keywordflow">if</font> ( !stay_active && ( receiver != <font class="keyword">this</font> ) )
00300 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a7">unActivate</a>();
00301 }
00302
<a name="l00306"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#b1">00306</a> <font class="keywordtype">void</font> CActorScript::switchActor(std::vector<CActorScript *> &actors, <font class="keywordtype">bool</font> stay_active)
00307 {
00308 std::vector<CActorScript *>::iterator it_act = actors.begin();
00309 <font class="keywordflow">while</font> ( it_act != actors.end() )
00310 {
00311 ( *it_act )->activate();
00312 it_act++;
00313 }
00314
00315 <font class="comment">// TODO: Envoi de message "activate" </font>
00316 <font class="keywordflow">if</font> ( !stay_active )
00317 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a7">unActivate</a>();
00318 }
00319
<a name="l00323"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#b2">00323</a> <font class="keywordtype">void</font> CActorScript::switchActor(std::vector<CComponentHandle *> &handles, <font class="keywordtype">bool</font> stay_active)
00324 {
00325 std::vector<CComponentHandle *>::iterator it_handle = handles.begin();
00326 <font class="keywordflow">while</font> ( it_handle != handles.end() )
00327 {
00328 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *actor = (<a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *)( *it_handle )->getValue();
00329 <font class="keywordflow">if</font> ( actor != NULL )
00330 actor->activate();
00331 <font class="keywordflow">else</font>
00332 {
00333 <font class="keyword">const</font> <font class="keywordtype">char</font> *sw_name = (*it_handle)->getCompName()->getString();
00334 <a class="code" href="debug_8h.html#a2">nlwarning</a>(<font class="stringliteral">"SWITCH: component %s not found."</font>, sw_name);
00335 }
00336 it_handle++;
00337 }
00338 <font class="comment">// TODO: Envoi de message "activate" </font>
00339 <font class="keywordflow">if</font> ( !stay_active )
00340 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a7">unActivate</a>();
00341 }
00342
00343
<a name="l00345"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a6">00345</a> <font class="keywordtype">void</font> CActorScript::onActivate()
00346 {
00347 <font class="comment">// Default behaviour: do nothing</font>
00348 }
00349
<a name="l00351"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a8">00351</a> <font class="keywordtype">void</font> CActorScript::onUnActivate()
00352 {
00353 <font class="comment">// default behaviour: do nothing</font>
00354 }
00355
<a name="l00356"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a9">00356</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CActorScript::clone()<font class="keyword"> const</font>
00357 <font class="keyword"> </font>{
00358 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *m = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a>(*<font class="keyword">this</font>);
00359 <font class="keywordflow">return</font> m;
00360 }
00361
<a name="l00362"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a10">00362</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CActorScript::newInstance()<font class="keyword"> const</font>
00363 <font class="keyword"> </font>{
00364 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *instance;
00365 <font class="keywordflow">if</font> ( _AgentClass )
00366 {
00367 instance = (<a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *) <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n4">_AgentClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#a6">buildNewInstance</a>();
00368 }
00369 <font class="keywordflow">else</font>
00370 {
00371 instance = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a>(NULL);
00372 }
00373 <font class="keywordflow">return</font> instance;
00374 }
00375
<a name="l00376"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a11">00376</a> <font class="keywordtype">void</font> CActorScript::getDebugString(std::string &<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>)<font class="keyword"> const</font>
00377 <font class="keyword"> </font>{
00378 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> = <font class="stringliteral">"CActorScript "</font>;
00379 <font class="keywordflow">if</font> ( _IsActivated )
00380 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> += <font class="stringliteral">"<active>"</font>;
00381 <font class="keywordflow">else</font>
00382 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> += <font class="stringliteral">"<idle>"</font>;
00383 }
00384
<a name="l00385"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a12">00385</a> <font class="keywordtype">bool</font> <a class="code" href="chain_8cpp.html#a2">CActorScript::isEqual</a>(<font class="keyword">const</font> IBasicObjectIA &a)<font class="keyword"> const</font>
00386 <font class="keyword"> </font>{
00387 <font class="keywordflow">return</font> <font class="keyword">true</font>;
00388 }
00389
<a name="l00390"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a15">00390</a> IObjectIA::CProcessResult CActorScript::sendMessage(IObjectIA *m)
00391 {
00392 <font class="keywordflow">return</font> CAgentScript::sendMessage(m);
00393 }
00394
<a name="l00395"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a13">00395</a> <font class="keywordtype">void</font> CActorScript::processMessages()
00396 {
00397 <font class="comment">//if ( _IsActivated )</font>
00398 CAgentScript::processMessages();
00399 }
00400
<a name="l00401"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a14">00401</a> <font class="keyword">const</font> IObjectIA::CProcessResult &CActorScript::run()
00402 {
00403 <font class="keywordflow">if</font> ( _IsActivated )
00404 {
00405 <font class="keywordflow">if</font> ( <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n3">_OnActivateIndex</a> != -1 )
00406 {
00407 <font class="keywordflow">if</font> ( <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z142_17">getAgentManager</a>() != NULL )
00408 {
00409 <a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> *context = (<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> *) <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z142_17">getAgentManager</a>()->getAgentContext();
00410 context-><a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m3">Self</a> = <font class="keyword">this</font>;
00411 CProcessResult <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z144_23">runMethodeMember</a>( <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n3">_OnActivateIndex</a> ,context);
00412 <font class="keywordflow">if</font> ( <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result != NULL )
00413 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result->release();
00414 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n3">_OnActivateIndex</a> = -1;
00415 }
00416 }
00417 <font class="keywordflow">return</font> CAgentScript::run();
00418 }
00419 <font class="keywordflow">else</font>
00420 {
00421 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a13">processMessages</a>();
00422 <font class="keywordflow">return</font> IObjectIA::ProcessRun;
00423 }
00424 }
00425
<a name="l00426"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a16">00426</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> &CActorScript::getType()<font class="keyword"> const</font>
00427 <font class="keyword"> </font>{
00428 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#p4">IdActorScript</a>;
00429 }
00430
<a name="l00431"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a17">00431</a> <font class="keywordtype">void</font> CActorScript::save(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &os)
00432 {
00433 CAgentScript::save(os);
00434 sint32 b = (<a class="code" href="classNLAIAGENT_1_1CActorScript.html#n0">_IsActivated</a> == <font class="keyword">false</font>);
00435 os.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( b );
00436 }
00437
<a name="l00438"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a18">00438</a> <font class="keywordtype">void</font> CActorScript::load(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &is)
00439 {
00440 CAgentScript::load(is);
00441 sint32 b;
00442 is.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( b );
00443 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n0">_IsActivated</a> = !b ;
00444 }
00445
<a name="l00446"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a20">00446</a> sint32 CActorScript::getMethodIndexSize()<font class="keyword"> const</font>
00447 <font class="keyword"> </font>{
00448 <font class="keywordflow">return</font> CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t18">fid_last</a>;
00449 }
00450
00451 <font class="comment">// virtual IObjectIA::CProcessResult runMethodBase(int heritance, int index,IObjectIA *);</font>
00452
00453
<a name="l00454"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a22">00454</a> IObjectIA::CProcessResult CActorScript::runMethodBase(<font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,<font class="keywordtype">int</font> heritance, IObjectIA *<a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>)
00455 {
00456 IObjectIA::CProcessResult <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00457
00458 <font class="keywordflow">switch</font> ( index )
00459 {
00460 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t0">fid_activate</a>:
00461 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a5">activate</a>();
00462 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00463 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00464 <font class="keywordflow">break</font>;
00465
00466 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t1">fid_onActivate</a>:
00467 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a6">onActivate</a>();
00468 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00469 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00470 <font class="keywordflow">break</font>;
00471
00472 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t2">fid_unActivate</a>:
00473 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a7">unActivate</a>();
00474 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00475 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00476 <font class="keywordflow">break</font>;
00477
00478 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t3">fid_onUnActivate</a>:
00479 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a8">onUnActivate</a>();
00480 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00481 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00482 <font class="keywordflow">break</font>;
00483
00484 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t4">fid_switch</a>:
00485 {
00486 std::vector<CStringType *> handles;
00487 <font class="keywordflow">if</font> ( ( (<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *) <a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>)->size() )
00488 {
00489 IBaseGroupType *fw = (IBaseGroupType *) ( ((<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *)<a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>) )->getFront();
00490 <font class="comment">//( ((NLAIAGENT::IBaseGroupType *)params))->popFront();</font>
00491 <font class="keywordflow">while</font> ( fw->size() )
00492 {
00493 handles.push_back( (CStringType *) fw->getFront() );
00494 fw->popFront();
00495 }
00496 std::vector<CComponentHandle *> switched;
00497 <font class="keywordflow">for</font> ( <font class="keywordtype">int</font> i = 0; i < (int) handles.size(); i++)
00498 switched.push_back( <font class="keyword">new</font> CComponentHandle( handles[ i ]->getStr() , (<a class="code" href="classNLAIAGENT_1_1IAgent.html#b0">IAgent</a> *) <a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a3">getParent</a>() ) );
00499
00500 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#b0">switchActor</a>( switched, <font class="keyword">false</font> );
00501 }
00502 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00503 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00504 }
00505 <font class="keywordflow">break</font>;
00506
00507 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t5">fid_launch</a>:
00508
00509 <font class="keywordflow">if</font> ( ( (<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *) <a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>)->size() )
00510 {
00511 <font class="comment">/*IObjectIA *child = (IObjectIA *)((NLAIAGENT::IBaseGroupType *)params)->get();</font>
00512 <font class="comment"> addDynamicAgent( (NLAIAGENT::IBaseGroupType *) params); </font>
00513 <font class="comment"> if ( child->isClassInheritedFrom( CStringVarName("Actor") ) != -1 )</font>
00514 <font class="comment"> {</font>
00515 <font class="comment"> if ( _TopLevel )</font>
00516 <font class="comment"> ((CActorScript *)child)->setTopLevel( _TopLevel );</font>
00517 <font class="comment"> else</font>
00518 <font class="comment"> ((CActorScript *)child)->setTopLevel( this );</font>
00519 <font class="comment"> </font>
00520 <font class="comment"> ((CActorScript *)child)->activate();</font>
00521 <font class="comment"> }</font>
00522 <font class="comment"></font>
00523 <font class="comment"> _Launched.push_back( (NLAIAGENT::IAgent *) child );</font>
00524 <font class="comment"> child->incRef();*/</font>
00525 CIteratorContener i = ((<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *) <a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>)->getIterator();
00526 CStringType &<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a> = (CStringType &)*i++;
00527 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b0">IBasicAgent</a> *a = (<a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b0">IBasicAgent</a> *)i++;
00528 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a39">Launch</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>.getStr().getString(), a);
00529 a->incRef();
00530 }
00531 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00532 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00533 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00534
00535 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t6">fid_launch_goal</a>:
00536 {
00537 <a class="code" href="classNLAILOGIC_1_1CGoalPath.html">NLAILOGIC::CGoalPath</a> *goal_path = <font class="keyword">new</font> <a class="code" href="classNLAILOGIC_1_1CGoalPath.html">NLAILOGIC::CGoalPath</a>( <font class="keyword">this</font> );
00538 goal_path-><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a4">setFather</a>( (CProxyAgentMail *) <font class="keyword">new</font> CLocalAgentMail( <font class="keyword">this</font> ) );
00539 <font class="comment">// If the constructor() function is explicitely called and the object has already been initialised</font>
00540 <a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *p = (<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *) <a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>;
00541 <font class="keywordflow">while</font> ( p-><a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_12">size</a>() )
00542 {
00543 goal_path-><a class="code" href="classNLAILOGIC_1_1CGoalPath.html#a3">addGoal</a>( (<a class="code" href="classNLAILOGIC_1_1CGoal.html">NLAILOGIC::CGoal</a> *) p-><a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_11">getFront</a>()->clone() );
00544 p-><a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html#z136_9">popFront</a>();
00545 }
00546 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a39">Launch</a>( <font class="stringliteral">"goal_path"</font>, goal_path );
00547 goal_path-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a2">incRef</a>();
00548 <font class="keywordflow">return</font> IObjectIA::CProcessResult();
00549 }
00550
00551 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t7">fid_launched</a>:
00552 {
00553 CVectorGroupType *result = <font class="keyword">new</font> CVectorGroupType();
00554 <a class="code" href="classstd_1_1list.html">std::list<IBasicAgent *></a>::iterator it_l = <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.begin();
00555
00556 <font class="keywordflow">while</font> ( it_l != <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.end() )
00557 {
00558 result->push( <font class="keyword">new</font> CLocalMailBox( (<font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IWordNumRef.html">NLAIAGENT::IWordNumRef</a> *) **it_l ) );
00559 it_l++;
00560 }
00561 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00562 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = result;
00563 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00564 }
00565
00566 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t8">fid_pause</a>:
00567 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a29">pause</a>();
00568 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00569 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00570 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00571
00572 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t9">fid_restart</a>:
00573 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a30">restart</a>();
00574 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00575 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00576 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00577
00578 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t10">fid_success</a>:
00579 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t11">fid_msg_success</a>:
00580 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a33">onSuccess</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>);
00581 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CSuccessMsg.html">NLAIAGENT::CSuccessMsg</a>();
00582 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00583
00584 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t12">fid_failure</a>:
00585 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t13">fid_msg_failure</a>:
00586 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a34">onFailure</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>);
00587 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CFailureMsg.html">NLAIAGENT::CFailureMsg</a>();
00588 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00589
00590 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t14">fid_nb_answers</a>:
00591 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n9">_NbAnswers</a> = (uint32) ( (<a class="code" href="classNLAIAGENT_1_1DigitalType.html">NLAIAGENT::DigitalType</a> *) ( (<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *) <a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a> )->get() )->getNumber();
00592 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00593
00594 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t15">fid_toplevel</a>:
00595 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = <font class="keyword">new</font> CLocalAgentMail( (<a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b0">IBasicAgent</a> *) <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a37">getTopLevel</a>() );
00596 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00597
00598 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t16">fid_owner</a>:
00599 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = <font class="keyword">new</font> CLocalAgentMail( (<a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b0">IBasicAgent</a> *) <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a37">getTopLevel</a>()-><a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a3">getParent</a>() );
00600 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00601
00602 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t17">fid_isactive</a>:
00603 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = <font class="keyword">new</font> <a class="code" href="classNLAILOGIC_1_1CBoolType.html">NLAILOGIC::CBoolType</a>( <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n0">_IsActivated</a> );
00604 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00605 }
00606 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00607 }
00608
<a name="l00609"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a39">00609</a> <font class="keywordtype">void</font> CActorScript::Launch(<font class="keyword">const</font> std::string &name, <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html">NLAIAGENT::IBasicAgent</a> *child)
00610 {
00611
00612 CStringType stringName( name.c_str() );
00613 <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z142_2">addDynamicAgent</a>( stringName , child );
00614 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n9">_NbAnswers</a>++;
00615
00616 <font class="keywordflow">if</font> ( child-><a class="code" href="classNLAIAGENT_1_1IObjectIA.html#a13">isClassInheritedFrom</a>( CStringVarName(<font class="stringliteral">"Actor"</font>) ) != -1 )
00617 {
00618 <font class="keywordflow">if</font> ( _TopLevel )
00619 ((<a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *)child)->setTopLevel( <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n12">_TopLevel</a> );
00620 <font class="keywordflow">else</font>
00621 ((<a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *)child)->setTopLevel( <font class="keyword">this</font> );
00622
00623 ((<a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *)child)->activate();
00624 }
00625
00626 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n11">_Launched</a>.push_back( (<a class="code" href="classNLAIAGENT_1_1IAgent.html">NLAIAGENT::IAgent</a> *) child );
00627 }
00628
00629
<a name="l00630"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a23">00630</a> IObjectIA::CProcessResult CActorScript::runMethodBase(<font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>,IObjectIA *<a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>)
00631 {
00632 <font class="keywordtype">int</font> i = <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> - CAgentScript::getMethodIndexSize();
00633
00634
00635 IObjectIA::CProcessResult <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00636 std::vector<CStringType *> handles;
00637
00638 <font class="keywordflow">switch</font>( i )
00639 {
00640
00641 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t0">fid_activate</a>:
00642 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a5">activate</a>();
00643 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00644 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00645 <font class="keywordflow">break</font>;
00646
00647 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t1">fid_onActivate</a>:
00648 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a6">onActivate</a>();
00649 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00650 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00651 <font class="keywordflow">break</font>;
00652
00653 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t2">fid_unActivate</a>:
00654 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a7">unActivate</a>();
00655 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00656 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00657 <font class="keywordflow">break</font>;
00658
00659 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t3">fid_onUnActivate</a>:
00660 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a8">onUnActivate</a>();
00661 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00662 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00663 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00664 <font class="keywordflow">break</font>;
00665
00666 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t4">fid_switch</a>:
00667 <font class="keywordflow">if</font> ( ( (<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *) <a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>)->size() )
00668 {
00669 <font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IObjectIA.html#b0">IObjectIA</a> *fw = ( ((<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *)<a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>) )->get();
00670
00671 <font class="comment">//( ((NLAIAGENT::IBaseGroupType *)params))->popFront();</font>
00672 <font class="comment">// while ( fw->size() )</font>
00673 <font class="comment">// {</font>
00674 handles.push_back( (CStringType *) fw);
00675 <font class="comment">// fw->popFront();</font>
00676 <font class="comment">// }</font>
00677
00678 std::vector<CComponentHandle *> switched;
00679 <font class="keywordtype">int</font> i;
00680 <font class="keywordflow">for</font> ( i = 0; i < (int) handles.size(); i++)
00681 switched.push_back( <font class="keyword">new</font> CComponentHandle( handles[ i ]->getStr(), (<a class="code" href="classNLAIAGENT_1_1IAgent.html#b0">IAgent</a> *) <a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a3">getParent</a>() ) );
00682 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#b0">switchActor</a>( switched, <font class="keyword">false</font> );
00683 <font class="keywordflow">for</font> ( i = 0; i < (int) switched.size(); i++)
00684 <font class="keyword">delete</font> switched[i];
00685 }
00686 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00687 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00688 <font class="keywordflow">break</font>;
00689
00690 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t5">fid_launch</a>:
00691 <font class="keywordflow">if</font> ( ( (<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *) <a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>)->size() )
00692 {
00693 <font class="comment">/*IObjectIA *child = (IObjectIA *)((NLAIAGENT::IBaseGroupType *)params)->get();</font>
00694 <font class="comment"> addDynamicAgent( (NLAIAGENT::IBaseGroupType *) params);</font>
00695 <font class="comment"> _NbAnswers++;</font>
00696 <font class="comment"> if ( child->isClassInheritedFrom( CStringVarName("Actor") ) != -1 )</font>
00697 <font class="comment"> {</font>
00698 <font class="comment"> if ( _TopLevel )</font>
00699 <font class="comment"> ((CActorScript *)child)->setTopLevel( _TopLevel );</font>
00700 <font class="comment"> else</font>
00701 <font class="comment"> ((CActorScript *)child)->setTopLevel( this );</font>
00702 <font class="comment"> </font>
00703 <font class="comment"> ((CActorScript *)child)->activate();</font>
00704 <font class="comment"> }</font>
00705 <font class="comment"> _Launched.push_back( (NLAIAGENT::IAgent *) child );</font>
00706 <font class="comment"> child->incRef();*/</font>
00707
00708 CIteratorContener i = ((<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *) <a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>)->getIterator();
00709 CStringType &<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a> = (CStringType &)*i++;
00710 <a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b0">IBasicAgent</a> *a = (<a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b0">IBasicAgent</a> *)i++;
00711 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a39">Launch</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>.getStr().getString(), a);
00712 a->incRef();
00713
00714 }
00715 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00716 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00717 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00718
00719 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t8">fid_pause</a>:
00720 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a29">pause</a>();
00721 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00722 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00723 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00724 <font class="keywordflow">break</font>;
00725
00726 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t9">fid_restart</a>:
00727 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a30">restart</a>();
00728 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.ResultState = NLAIAGENT::processIdle;
00729 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = NULL;
00730 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00731 <font class="keywordflow">break</font>;
00732
00733 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t10">fid_success</a>:
00734 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t11">fid_msg_success</a>:
00735 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a25">processSuccess</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>);
00736 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CSuccessMsg.html">NLAIAGENT::CSuccessMsg</a>();
00737 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00738 <font class="keywordflow">break</font>;
00739
00740 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t12">fid_failure</a>:
00741 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t13">fid_msg_failure</a>:
00742 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a26">processFailure</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>);
00743 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CFailureMsg.html">NLAIAGENT::CFailureMsg</a>();
00744 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00745 <font class="keywordflow">break</font>;
00746
00747 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t14">fid_nb_answers</a>:
00748 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n9">_NbAnswers</a> = (uint32) ( (<a class="code" href="classNLAIAGENT_1_1DigitalType.html">NLAIAGENT::DigitalType</a> *) ( (<a class="code" href="classNLAIAGENT_1_1IBaseGroupType.html">NLAIAGENT::IBaseGroupType</a> *) <a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a> )->get() )->getNumber();
00749 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00750
00751 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t15">fid_toplevel</a>:
00752 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = <font class="keyword">new</font> CLocalAgentMail( (<a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b0">IBasicAgent</a> *) <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a37">getTopLevel</a>() );
00753 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00754 <font class="keywordflow">break</font>;
00755
00756 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t16">fid_owner</a>:
00757 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = <font class="keyword">new</font> CLocalAgentMail( (<a class="code" href="classNLAIAGENT_1_1IBasicAgent.html#b0">IBasicAgent</a> *) <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a37">getTopLevel</a>()-><a class="code" href="classNLAIAGENT_1_1IConnectIA.html#a3">getParent</a>() );
00758 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00759 <font class="keywordflow">break</font>;
00760
00761 <font class="keywordflow">case</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t17">fid_isactive</a>:
00762 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.Result = <font class="keyword">new</font> <a class="code" href="classNLAILOGIC_1_1CBoolType.html">NLAILOGIC::CBoolType</a>( <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n0">_IsActivated</a> );
00763 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>;
00764 <font class="keywordflow">break</font>;
00765 }
00766 <font class="keywordflow">return</font> CAgentScript::runMethodBase(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a357">params</a>);
00767 }
00768
<a name="l00769"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a19">00769</a> <font class="keywordtype">int</font> CActorScript::getBaseMethodCount()<font class="keyword"> const</font>
00770 <font class="keyword"> </font>{
00771 <font class="keywordflow">return</font> CAgentScript::getBaseMethodCount() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t18">fid_last</a>;
00772 }
00773
<a name="l00774"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a21">00774</a> <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> CActorScript::getPrivateMember(<font class="keyword">const</font> IVarName *className,<font class="keyword">const</font> IVarName *name,<font class="keyword">const</font> IObjectIA &<a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a>)<font class="keyword"> const</font>
00775 <font class="keyword"> </font>{
00776
00777 <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> result;
00778
00779 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> activate_name(<font class="stringliteral">"activate"</font>);
00780 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> onactivate_name(<font class="stringliteral">"onActivate"</font>);
00781 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> unactivate_name(<font class="stringliteral">"unActivate"</font>);
00782 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> onunactivate_name(<font class="stringliteral">"onUnActivate"</font>);
00783 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> switch_name(<font class="stringliteral">"switch"</font>);
00784 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> launch_name(<font class="stringliteral">"Launch"</font>);
00785 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> launch_goal_name(<font class="stringliteral">"LaunchGoals"</font>);
00786 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> launched_name(<font class="stringliteral">"Launched"</font>);
00787 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> tell_name(<font class="stringliteral">"RunTell"</font>);
00788 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> toplevel_name(<font class="stringliteral">"TopLevel"</font>);
00789 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> owner_name(<font class="stringliteral">"Owner"</font>);
00790 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> success_name(<font class="stringliteral">"Success"</font>);
00791 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> failure_name(<font class="stringliteral">"Failure"</font>);
00792 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> pause_name(<font class="stringliteral">"Pause"</font>);
00793 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> restart_name(<font class="stringliteral">"Restart"</font>);
00794 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> isactive_name(<font class="stringliteral">"IsActivated"</font>);
00795 <font class="keyword">static</font> <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a> _NbAnswers_name(<font class="stringliteral">"WaitFor"</font>);
00796
00797
00798 <font class="keywordflow">if</font> ( *name == activate_name )
00799 {
00800 <a class="code" href="classNLAIAGENT_1_1CObjectType.html">NLAIAGENT::CObjectType</a> *r_type = <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>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00801 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t0">fid_activate</a>, 0.0,NULL, r_type ) );
00802 }
00803
00804 <font class="keywordflow">if</font> ( *name == onactivate_name )
00805 {
00806 <a class="code" href="classNLAIAGENT_1_1CObjectType.html">NLAIAGENT::CObjectType</a> *r_type = <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>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00807 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t1">fid_onActivate</a> , 0.0,NULL, r_type ) );
00808 }
00809
00810 <font class="keywordflow">if</font> ( *name == unactivate_name )
00811 {
00812 CObjectType *r_type = <font class="keyword">new</font> CObjectType( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00813 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t3">fid_onUnActivate</a>, 0.0,NULL, r_type ) );
00814 }
00815
00816 <font class="keywordflow">if</font> ( *name == onunactivate_name )
00817 {
00818 CObjectType *r_type = <font class="keyword">new</font> CObjectType( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00819 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t2">fid_unActivate</a>, 0.0,NULL, r_type ) );
00820 }
00821
00822 <font class="keywordflow">if</font> ( *name == switch_name )
00823 {
00824 CObjectType *r_type = <font class="keyword">new</font> CObjectType( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00825 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t4">fid_switch</a>, 0.0, NULL, r_type ) );
00826 }
00827
00828 <font class="keywordflow">if</font> ( *name == launch_name )
00829 {
00830 CObjectType *r_type = <font class="keyword">new</font> CObjectType( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00831 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t5">fid_launch</a>, 0.0, NULL, r_type ) );
00832 }
00833
00834 <font class="keywordflow">if</font> ( *name == launch_goal_name )
00835 {
00836 CObjectType *r_type = <font class="keyword">new</font> CObjectType( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00837 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t6">fid_launch_goal</a>, 0.0, NULL, r_type ) );
00838 }
00839
00840 <font class="keywordflow">if</font> ( *name == launched_name )
00841 {
00842 CObjectType *r_type = <font class="keyword">new</font> CObjectType( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( <a class="code" href="classNLAIAGENT_1_1CVectorGroupType.html#p0">NLAIAGENT::CVectorGroupType::IdVectorGroupType</a> ) );
00843 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t7">fid_launched</a>, 0.0, NULL, r_type ) );
00844 }
00845
00846 <font class="comment">// Processes succes and failure functions</font>
00847 <font class="keywordflow">if</font> ( *name == tell_name )
00848 {
00849 <font class="keywordtype">double</font> d;
00850 d = ((<a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a> &)*<a class="code" href="classNLAIAGENT_1_1CActorScript.html#p1">ParamSuccessMsg</a>).eval((<a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a> &)<a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a>);
00851 <font class="keywordflow">if</font> ( d >= 0.0 )
00852 {
00853 <a class="code" href="classNLAIAGENT_1_1CObjectType.html">NLAIAGENT::CObjectType</a> *r_type = <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>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00854 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t11">fid_msg_success</a>, 0.0,NULL, r_type ) );
00855 }
00856
00857 d = ((<a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a> &)*<a class="code" href="classNLAIAGENT_1_1CActorScript.html#p3">ParamFailureMsg</a>).eval((<a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a> &)<a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a>);
00858 <font class="keywordflow">if</font> ( d >= 0.0 )
00859 {
00860 <a class="code" href="classNLAIAGENT_1_1CObjectType.html">NLAIAGENT::CObjectType</a> *r_type = <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>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00861 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t13">fid_msg_failure</a>, 0.0,NULL, r_type ) );
00862 }
00863 }
00864
00865 <font class="keywordflow">if</font> ( *name == toplevel_name )
00866 {
00867 CObjectType *r_type = <font class="keyword">new</font> CObjectType( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00868 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t15">fid_toplevel</a>, 0.0, NULL, r_type ) );
00869 }
00870
00871 <font class="keywordflow">if</font> ( *name == _NbAnswers_name )
00872 {
00873 CObjectType *r_type = <font class="keyword">new</font> CObjectType( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00874 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t14">fid_nb_answers</a>, 0.0, NULL, r_type ) );
00875 }
00876
00877
00878 <font class="keywordflow">if</font> ( *name == owner_name )
00879 {
00880 CObjectType *r_type = <font class="keyword">new</font> CObjectType( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00881 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t16">fid_owner</a>, 0.0, NULL, r_type ) );
00882 }
00883
00884 <font class="keywordflow">if</font> ( *name == success_name )
00885 {
00886 CObjectType *r_type = <font class="keyword">new</font> CObjectType( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00887 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t10">fid_success</a>, 0.0, NULL, r_type ) );
00888 }
00889
00890 <font class="keywordflow">if</font> ( *name == failure_name )
00891 {
00892 CObjectType *r_type = <font class="keyword">new</font> CObjectType( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00893 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t12">fid_failure</a>, 0.0, NULL, r_type ) );
00894 }
00895
00896 <font class="keywordflow">if</font> ( *name == pause_name )
00897 {
00898 CObjectType *r_type = <font class="keyword">new</font> CObjectType( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00899 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t8">fid_pause</a>, 0.0, NULL, r_type ) );
00900 }
00901
00902 <font class="keywordflow">if</font> ( *name == restart_name )
00903 {
00904 CObjectType *r_type = <font class="keyword">new</font> CObjectType( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00905 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t9">fid_restart</a>, 0.0, NULL, r_type ) );
00906 }
00907
00908 <font class="keywordflow">if</font> ( *name == isactive_name )
00909 {
00910 CObjectType *r_type = <font class="keyword">new</font> CObjectType( <font class="keyword">new</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a>( <a class="code" href="classNLAIC_1_1CIdentType.html#p0">NLAIC::CIdentType::VoidType</a> ) );
00911 result.push( <a class="code" href="structNLAIAGENT_1_1CIdMethod.html">NLAIAGENT::CIdMethod</a>( CAgentScript::getMethodIndexSize() + <a class="code" href="classNLAIAGENT_1_1CActorScript.html#t19t17">fid_isactive</a>, 0.0, NULL, r_type ) );
00912 }
00913
00914 <font class="keywordflow">if</font> ( result.empty() )
00915 <font class="keywordflow">return</font> CAgentScript::getPrivateMember(className, name, <a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a>);
00916
00917 <font class="keywordflow">return</font> result;
00918 }
00919
00920
<a name="l00921"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a24">00921</a> <font class="keywordtype">void</font> CActorScript::cancel()
00922 {
00923 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a7">unActivate</a>();
00924 }
00925
<a name="l00926"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a35">00926</a> <font class="keywordtype">float</font> CActorScript::priority()<font class="keyword"> const</font>
00927 <font class="keyword"> </font>{
00928 <font class="comment">// Look at predecessors priorities</font>
00929 <font class="keywordflow">return</font> 1.0;
00930 }
00931
<a name="l00932"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a36">00932</a> <font class="keywordtype">void</font> CActorScript::setTopLevel(CAgentScript *tl)
00933 {
00934 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n12">_TopLevel</a> = tl;
00935
00936 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> i = 0; i < <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n1">_NbComponents</a>; i++ )
00937 {
00938 <font class="keywordflow">if</font> ( <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n0">_Components</a>[i]->isClassInheritedFrom( <a class="code" href="classNLAIAGENT_1_1CStringVarName.html">NLAIAGENT::CStringVarName</a>(<font class="stringliteral">"Actor"</font>) ) != -1 )
00939 {
00940 <font class="keywordflow">if</font> ( _TopLevel )
00941 ( (<a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *)<a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n0">_Components</a>[i] )->setTopLevel( <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n12">_TopLevel</a> );
00942 <font class="keywordflow">else</font>
00943 ( (<a class="code" href="classNLAIAGENT_1_1CActorScript.html#a0">CActorScript</a> *)<a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n0">_Components</a>[i] )->setTopLevel( <font class="keyword">this</font> );
00944 }
00945 }
00946 }
00947
<a name="l00948"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a37">00948</a> <font class="keyword">const</font> CAgentScript *CActorScript::getTopLevel()<font class="keyword"> const</font>
00949 <font class="keyword"> </font>{
00950 <font class="keywordflow">return</font> <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n12">_TopLevel</a>;
00951 }
00952
<a name="l00953"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a25">00953</a> <font class="keywordtype">void</font> CActorScript::processSuccess(<a class="code" href="classNLAIAGENT_1_1IObjectIA.html">NLAIAGENT::IObjectIA</a> *<a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a>)
00954 {
00955
00956 <font class="preprocessor">#ifdef NL_DEBUG</font>
00957 <font class="preprocessor"></font> <font class="keyword">const</font> <font class="keywordtype">char</font> *dbg_type = (<font class="keyword">const</font> <font class="keywordtype">char</font> *) <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a16">getType</a>();
00958 <font class="preprocessor">#endif</font>
00959 <font class="preprocessor"></font><font class="comment">// _NbAnswers--;</font>
00960 <font class="comment">// if ( _NbAnswers < 1 )</font>
00961 <font class="comment">// { </font>
00962 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a27">success</a>();
00963 <font class="comment">// }</font>
00964 }
00965
<a name="l00966"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a27">00966</a> <font class="keywordtype">void</font> CActorScript::success()
00967 {
00968 <font class="keyword">static</font> CStringVarName onsuccess_func_name(<font class="stringliteral">"OnSuccess"</font>);
00969 <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n4">_AgentClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#z232_5">isMember</a>( NULL, &onsuccess_func_name, <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a>() );
00970 <font class="keywordflow">if</font> ( !<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.empty() )
00971 {
00972 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n7">_OnSuccessIndex</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.top().Index;
00973 <font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IAgentManager.html">NLAIAGENT::IAgentManager</a> *manager = <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z142_17">getAgentManager</a>();
00974 <font class="keywordflow">if</font> ( manager != NULL )
00975 {
00976 <a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> *context = (<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> *) manager-><a class="code" href="classNLAIAGENT_1_1IAgentManager.html#a3">getAgentContext</a>();
00977 context-><a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m3">Self</a> = <font class="keyword">this</font>;
00978 <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z144_23">runMethodeMember</a>( <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n7">_OnSuccessIndex</a> ,context);
00979 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n7">_OnSuccessIndex</a> = -1;
00980 }
00981 }
00982 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a33">onSuccess</a>( NULL );
00983 }
00984
<a name="l00985"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a28">00985</a> <font class="keywordtype">void</font> CActorScript::failure()
00986 {
00987 <font class="keyword">static</font> CStringVarName onfailure_func_name(<font class="stringliteral">"OnFailure"</font>);
00988 <a class="code" href="namespaceNLAIAGENT.html#a1">tQueue</a> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#n4">_AgentClass</a>-><a class="code" href="classNLAISCRIPT_1_1CAgentClass.html#z232_5">isMember</a>( NULL, &onfailure_func_name, <a class="code" href="classNLAISCRIPT_1_1CParam.html">NLAISCRIPT::CParam</a>() );
00989 <font class="keywordflow">if</font> ( !<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.empty() )
00990 {
00991 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n8">_OnFailureIndex</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>.top().Index;
00992 <font class="keyword">const</font> <a class="code" href="classNLAIAGENT_1_1IAgentManager.html">NLAIAGENT::IAgentManager</a> *manager = <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z142_17">getAgentManager</a>();
00993 <font class="keywordflow">if</font> ( manager != NULL )
00994 {
00995 <a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> *context = (<a class="code" href="classNLAISCRIPT_1_1CCodeContext.html">NLAISCRIPT::CCodeContext</a> *) manager-><a class="code" href="classNLAIAGENT_1_1IAgentManager.html#a3">getAgentContext</a>();
00996 context-><a class="code" href="classNLAISCRIPT_1_1CCodeContext.html#m3">Self</a> = <font class="keyword">this</font>;
00997 <a class="code" href="classNLAIAGENT_1_1CAgentScript.html#z144_23">runMethodeMember</a>( <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n8">_OnFailureIndex</a> ,context);
00998 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#n8">_OnFailureIndex</a> = -1;
00999 }
01000 }
01001 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a34">onFailure</a>( NULL );
01002 }
01003
<a name="l01004"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a26">01004</a> <font class="keywordtype">void</font> CActorScript::processFailure(<a class="code" href="classNLAIAGENT_1_1IObjectIA.html">NLAIAGENT::IObjectIA</a> *<a class="code" href="driver__opengl__extension__def_8h.html#a382">param</a>)
01005 {
01006
01007
01008 <font class="preprocessor">#ifdef NL_DEBUG</font>
01009 <font class="preprocessor"></font> <font class="keyword">const</font> <font class="keywordtype">char</font> *dbg_type = (<font class="keyword">const</font> <font class="keywordtype">char</font> *) <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a16">getType</a>();
01010 <font class="preprocessor">#endif</font>
01011 <font class="preprocessor"></font>
01012 <font class="comment">// _NbAnswers--;</font>
01013 <font class="comment">// if ( _NbAnswers < 1 )</font>
01014 <font class="comment">// {</font>
01015 param-><a class="code" href="classNLAIC_1_1IPointerGestion.html#a2">incRef</a>();
01016 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a28">failure</a>();
01017 <font class="comment">// }</font>
01018 }
01019
<a name="l01020"></a><a class="code" href="classNLAIAGENT_1_1CActorScript.html#a38">01020</a> IMessageBase *CActorScript::runTell(<font class="keyword">const</font> IMessageBase &m)
01021 {
01022 <a class="code" href="classNLAIAGENT_1_1CActorScript.html#a25">processSuccess</a>( (<a class="code" href="classNLAIAGENT_1_1IObjectIA.html">NLAIAGENT::IObjectIA</a> *) m.getMessageGroup() );
01023 <font class="keywordflow">return</font> <font class="keyword">new</font> <a class="code" href="classNLAIAGENT_1_1CSuccessMsg.html">NLAIAGENT::CSuccessMsg</a>();
01024 }
01025 }
</pre></div>
<!-- footer -->
<BR><FONT Size=+5> </FONT>
</TD>
<TD WIDTH=15><IMG SRC=http://www.nevrax.org/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD>
</TR>
</TABLE>
</BODY>
</HTML>
|