-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathtype2string.cpp
825 lines (682 loc) · 25 KB
/
type2string.cpp
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
#include <good/log.h>
#include <good/string_buffer.h>
#include <good/string_utils.h>
#include "mod.h"
#include "server_plugin.h"
#include "type2string.h"
#include "mods/borzh/types_borzh.h"
#include "mods/hl2dm/types_hl2dm.h"
const good::string sUnknown("unknown");
const good::string sEmpty("");
const good::string sNone("none");
extern char* szMainBuffer;
extern int iMainBufferSize;
//================================================================================================================
const good::string& EnumToString( int iEnum, int iEnumCount, const good::string aStrings[], const good::string& sDefault )
{
GoodAssert( 0 <= iEnumCount );
return (0 <= iEnum && iEnum < iEnumCount) ? aStrings[iEnum] : sDefault;
}
int EnumFromString( const good::string& s, int iEnumCount, const good::string aStrings[] )
{
GoodAssert( 0 <= iEnumCount );
for ( int i=0; i < iEnumCount; ++i )
if ( s == aStrings[i] )
return i;
return -1;
}
//================================================================================================================
inline const good::string& EnumToString( int iEnum, const StringVector& aStrings, const good::string& sDefault )
{
return EnumToString( iEnum, aStrings.size(), aStrings.data(), sDefault );
}
inline int EnumFromString( const good::string& s, const StringVector& aStrings )
{
return EnumFromString( s, aStrings.size(), aStrings.data() );
}
//================================================================================================================
const good::string& FlagsToString( int iFlags, int iFlagsCount, const good::string aStrings[], bool bUseNone )
{
GoodAssert( 0 <= iFlagsCount );
if ( iFlags == 0 )
return bUseNone ? sNone : sEmpty;
static good::string_buffer sbBuffer(szMainBuffer, iMainBufferSize, false);
sbBuffer.erase();
for ( int i=0; i < iFlagsCount; ++i )
if ( FLAG_ALL_SET_OR_0(1<<i, iFlags) )
sbBuffer << aStrings[i] << ' ';
if ( sbBuffer.size() )
sbBuffer.erase(sbBuffer.size()-1, 1); // Erase last space.
return sbBuffer;
}
const good::string& FlagsToString( int iFlags, const StringVector& aStrings, bool bUseNone )
{
return FlagsToString( iFlags, aStrings.size(), aStrings.data(), bUseNone );
}
int FlagsFromString( const good::string& s, int iFlagsCount, const good::string aStrings[] )
{
GoodAssert( 0 <= iFlagsCount );
int iResult = 0;
StringVector aFlags;
good::split(s, aFlags, ' ', true);
for ( StringVector::size_type i=0; i < aFlags.size(); ++i )
{
int j;
for ( j=0; j < iFlagsCount; ++j )
{
if ( aFlags[i] == aStrings[j] )
{
FLAG_SET( 1<<j, iResult );
break;
}
}
if ( j == iFlagsCount ) // Couldn't find flag in array of strings, return an error.
return -1;
}
return iResult;
}
//****************************************************************************************************************
const good::string& CTypeToString::StringArrayToString( const good::string aStrings[], int iSize )
{
GoodAssert( 0 <= iSize );
static good::string_buffer sbBuffer(szMainBuffer, iMainBufferSize, false);
sbBuffer.erase();
for ( int i = 0; i < iSize; ++i )
sbBuffer << aStrings[i] << ' ';
if ( sbBuffer.size() )
sbBuffer.erase(sbBuffer.size()-1, 1); // Erase last space.
return sbBuffer;
}
//----------------------------------------------------------------------------------------------------------------
const int iYesNoSynonims = 4;
good::string aBools[2*iYesNoSynonims] =
{
"false",
"no",
"off",
"disable",
"true",
"yes",
"on",
"enable",
};
int CTypeToString::BoolFromString( const good::string& sBool )
{
int iResult = EnumFromString( sBool, 2*iYesNoSynonims, aBools );
return (iResult == -1) ? -1 : (iResult/iYesNoSynonims);
}
const good::string& CTypeToString::BoolToString( bool b, int which)
{
return aBools[b*iYesNoSynonims + which];
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TModId.
//----------------------------------------------------------------------------------------------------------------
good::string aMods[ EModId_Total ] =
{
"hl2dm",
"tf2",
"css",
"borzh"
};
int CTypeToString::ModFromString( const good::string& sMod )
{
return EnumFromString( sMod, EModId_Total, aMods );
}
const good::string& CTypeToString::ModToString( TModId iMod )
{
return EnumToString( iMod, EModId_Total, aMods, sUnknown );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TModId.
//----------------------------------------------------------------------------------------------------------------
good::string aModVars[ EModVarTotal ] =
{
"max_health",
"max_armor",
"player_width",
"player_height",
"player_height_crouched",
"player_eye",
"player_eye_crouched",
"velocity_crouch",
"velocity_walk",
"velocity_run",
"velocity_sprint",
"obstacle_height_no_jump",
"jump_height",
"jump_height_crouched",
"max_height_no_fall_damage",
"max_slope_gradient",
};
TModVar CTypeToString::ModVarFromString( const good::string& sVar )
{
return EnumFromString( sVar, EModVarTotal, aModVars );
}
const good::string& CTypeToString::ModVarToString( TModVar iVar )
{
return EnumToString( iVar, EModVarTotal, aModVars, sUnknown );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TCommandAccessFlags.
//----------------------------------------------------------------------------------------------------------------
good::string aAccessFlags[ECommandAccessFlagTotal] =
{
"waypoint",
"bot",
"config",
};
int CTypeToString::AccessFlagsFromString( const good::string& sFlags )
{
return FlagsFromString( sFlags, ECommandAccessFlagTotal, aAccessFlags );
}
const good::string& CTypeToString::AccessFlagsToString( TCommandAccessFlags iFlags, bool bUseNone )
{
return FlagsToString( iFlags, ECommandAccessFlagTotal, aAccessFlags, bUseNone );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TWaypointFlag.
//----------------------------------------------------------------------------------------------------------------
good::string aWaypointFlags[EWaypointFlagTotal] =
{
"stop",
"camper",
"sniper",
"weapon",
"ammo",
"health",
"armor",
"health-charger",
"armor-charger",
"button",
"see-button",
"use",
"elevator",
"ladder",
};
int CTypeToString::WaypointFlagsFromString( const good::string& sFlags )
{
return FlagsFromString( sFlags, EWaypointFlagTotal, aWaypointFlags );
}
const good::string& CTypeToString::WaypointFlagsToString(TWaypointFlags iFlags, bool bUseNone )
{
return FlagsToString( iFlags, EWaypointFlagTotal, aWaypointFlags, bUseNone );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TPathFlag.
//----------------------------------------------------------------------------------------------------------------
good::string aPathFlags[EPathFlagTotal] =
{
"crouch",
"jump",
"break",
"sprint",
"ladder",
"stop",
"damage",
"flashlight",
"door",
"elevator",
"totem",
"unused",
"unused",
"unused",
"untested",
"demo",
};
int CTypeToString::PathFlagsFromString( const good::string& sFlags )
{
return FlagsFromString( sFlags, EPathFlagTotal, aPathFlags );
}
const good::string& CTypeToString::PathFlagsToString( TPathFlags iFlags, bool bUseNone )
{
return FlagsToString( iFlags, EPathFlagTotal, aPathFlags, bUseNone );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TWaypointDrawFlags.
//----------------------------------------------------------------------------------------------------------------
good::string aDrawTypeFlags[EWaypointDrawFlagTotal] =
{
"beam",
"line",
"box",
"text",
};
int CTypeToString::WaypointDrawFlagsFromString( const good::string& sFlags )
{
return FlagsFromString( sFlags, EWaypointDrawFlagTotal, aDrawTypeFlags );
}
const good::string& CTypeToString::WaypointDrawFlagsToString( TWaypointDrawFlags iFlags, bool bUseNone )
{
return FlagsToString( iFlags, EWaypointDrawFlagTotal, aDrawTypeFlags, bUseNone );
}
int CTypeToString::PathDrawFlagsFromString( const good::string& sFlags )
{
return FlagsFromString( sFlags, EPathDrawFlagTotal, aDrawTypeFlags );
}
const good::string& CTypeToString::PathDrawFlagsToString( TPathDrawFlags iFlags, bool bUseNone )
{
return FlagsToString( iFlags, EPathDrawFlagTotal, aDrawTypeFlags, bUseNone );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TItemType.
//----------------------------------------------------------------------------------------------------------------
good::string aItemTypes[EItemTypeAll] =
{
"health",
"armor",
"weapon",
"ammo",
"button",
"door",
"ladder",
"object",
"spawn",
"other",
};
int CTypeToString::EntityTypeFromString( const good::string& sType )
{
return EnumFromString( sType, EItemTypeKnownTotal+1, aItemTypes );
}
const good::string& CTypeToString::EntityTypeToString( TItemType iType )
{
return EnumToString( iType, EItemTypeKnownTotal+1, aItemTypes, sUnknown );
}
int CTypeToString::EntityTypeFlagsFromString( const good::string& sFlags )
{
return FlagsFromString( sFlags, EItemTypeKnownTotal+1, aItemTypes );
}
const good::string& CTypeToString::EntityTypeFlagsToString( TItemTypeFlags iItemTypeFlags, bool bUseNone )
{
return FlagsToString( iItemTypeFlags, EItemTypeKnownTotal+1, aItemTypes, bUseNone );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TItemFlags.
//----------------------------------------------------------------------------------------------------------------
good::string aEntityClassFlags[ EItemFlagsTotal ] =
{
"use",
"respawnable",
"explosive",
"heavy",
"box",
"taken",
};
int CTypeToString::EntityClassFlagsFromString( const good::string& sFlags )
{
if ( sFlags == sNone )
return 0;
else
return FlagsFromString( sFlags, EItemFlagsTotal, aEntityClassFlags );
}
const good::string& CTypeToString::EntityClassFlagsToString( TItemFlags iItemFlags, bool bUseNone )
{
return FlagsToString( iItemFlags, EItemFlagsTotal, aEntityClassFlags, bUseNone );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TItemDrawFlags.
//----------------------------------------------------------------------------------------------------------------
good::string aItemDrawFlags[EItemDrawFlagTotal] =
{
"name",
"box",
"waypoint",
};
int CTypeToString::ItemDrawFlagsFromString( const good::string& sFlags )
{
return FlagsFromString( sFlags, EItemDrawFlagTotal, aItemDrawFlags );
}
const good::string& CTypeToString::ItemDrawFlagsToString( TItemDrawFlags iFlags, bool bUseNone )
{
return FlagsToString( iFlags, EItemDrawFlagTotal, aItemDrawFlags, bUseNone );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TWeaponType.
//----------------------------------------------------------------------------------------------------------------
good::string aWeaponTypes[EWeaponTotal] =
{
"melee",
"grenade",
"physics",
"remote",
"pistol",
"rifle",
"shotgun",
"rocket",
};
int CTypeToString::WeaponTypeFromString( const good::string& sType )
{
return EnumFromString( sType, EWeaponTotal, aWeaponTypes );
}
const good::string& CTypeToString::WeaponTypeToString( TWeaponType iType )
{
return EnumToString( iType, EWeaponTotal, aWeaponTypes, sUnknown );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TWeaponFlags.
//----------------------------------------------------------------------------------------------------------------
good::string aWeaponFlags[EWeaponFlagsTotal] =
{
"zoom",
"trigger",
"cure",
"push_away",
"deflect",
"extinguish",
"prepare",
"slowing",
"force_range",
"force_aim",
"same_ammo",
"dont_add_clip",
"default_empty",
"bg_reload"
};
TWeaponFlags CTypeToString::WeaponFlagsFromString( const good::string& sType )
{
return FlagsFromString( sType, EWeaponFlagsTotal, aWeaponFlags );
}
const good::string& CTypeToString::WeaponFlagsToString( TWeaponFlags iType, bool bUseNone )
{
return FlagsToString( iType, EWeaponFlagsTotal, aWeaponFlags, bUseNone );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TWeaponAim.
//----------------------------------------------------------------------------------------------------------------
good::string aWeaponAim[EWeaponAimTotal] =
{
"body",
"head",
"foot"
};
TWeaponAim CTypeToString::WeaponAimFromString( const good::string& sWeaponAim )
{
return EnumFromString( sWeaponAim, EWeaponAimTotal, aWeaponAim );
}
const good::string& CTypeToString::WeaponAimToString( TWeaponAim iWeaponAim )
{
return EnumToString( iWeaponAim, EWeaponAimTotal, aWeaponAim, sUnknown );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TPreference.
//----------------------------------------------------------------------------------------------------------------
good::string aPreferences[EBotIntelligenceTotal] =
{
"lowest",
"low",
"normal",
"high",
"highest",
};
int CTypeToString::PreferenceFromString( const good::string& sPreference )
{
return EnumFromString( sPreference, EBotIntelligenceTotal, aPreferences );
}
const good::string& CTypeToString::PreferenceToString( TBotIntelligence iPreference )
{
return EnumToString( iPreference, EBotIntelligenceTotal, aPreferences, sUnknown );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TPreference.
//----------------------------------------------------------------------------------------------------------------
good::string aIntelligences[EBotIntelligenceTotal] =
{
"fool",
"stupied",
"normal",
"smart",
"pro",
};
const good::string& CTypeToString::IntelligenceToString( TBotIntelligence iIntelligence )
{
return EnumToString( iIntelligence, EBotIntelligenceTotal, aIntelligences, sUnknown );
}
int CTypeToString::IntelligenceFromString( const good::string& sIntelligence )
{
return EnumFromString( sIntelligence, EBotIntelligenceTotal, aIntelligences );
}
//----------------------------------------------------------------------------------------------------------------
const good::string& CTypeToString::TeamToString( int iTeam )
{
return EnumToString( iTeam, CMod::aTeamsNames, sUnknown );
}
const good::string& CTypeToString::TeamFlagsToString( int iTeams, bool bUseNone )
{
return FlagsToString( iTeams, CMod::aTeamsNames, bUseNone );
}
int CTypeToString::TeamFromString( const good::string& sTeam )
{
return EnumFromString( sTeam, CMod::aTeamsNames );
}
//----------------------------------------------------------------------------------------------------------------
const good::string& CTypeToString::ClassToString( int iClass )
{
return EnumToString( iClass, CMod::aClassNames, sUnknown );
}
const good::string& CTypeToString::ClassFlagsToString( int iClasses, bool bUseNone )
{
return FlagsToString( iClasses, CMod::aClassNames, bUseNone );
}
int CTypeToString::ClassFromString( const good::string& sClass )
{
return EnumFromString( sClass, CMod::aClassNames );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TBotTasks.
//----------------------------------------------------------------------------------------------------------------
good::string aBotTasks[EBotTasksTotal] =
{
"find health",
"find armor",
"find weapon",
"find ammo",
"engage enemy",
"find enemy",
};
const good::string& CTypeToString::BotTaskToString( TBotTask iBotTask )
{
return EnumToString( iBotTask, EBotTasksTotal, aBotTasks, sUnknown );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TBotChat. Should be in lowercase.
//----------------------------------------------------------------------------------------------------------------
good::string aBotCommands[EBotChatTotal] =
{
"error",
"greeting",
"bye",
"busy",
"affirmative",
"negative",
"affirm",
"negate",
"call",
"call response",
"help",
"stop",
"come",
"follow",
"attack",
"no kill",
"sit down",
"stand up",
"jump",
"leave",
"dont hurt",
"ok",
"done",
"wait",
"no moves",
"think",
"explore",
"explore new",
"finish explore",
"new area",
"change area",
"weapon found",
"door found",
"door change",
"door no change",
"button see",
"button can push",
"button cant push",
"box found",
"box lost",
"gravity gun have",
"gravity gun need",
"wall found",
"box need",
"box try",
"box i take",
"box you take",
"box i drop",
"box you drop",
"button weapon",
"button no weapon",
"door try",
"button try",
"button try go",
"button door",
"button toggles",
"button no toggles",
"button i push",
"button you push",
"button i shoot",
"button you shoot",
"area go",
"area cant go",
"door go",
"button go",
"cancel task",
"better idea",
"found plan",
};
int CTypeToString::BotCommandFromString( const good::string& sCommand )
{
return EnumFromString( sCommand, EBotChatTotal, aBotCommands );
}
const good::string& CTypeToString::BotCommandToString( TBotChat iCommand )
{
return EnumToString( iCommand, EBotChatTotal, aBotCommands, sUnknown );
}
//----------------------------------------------------------------------------------------------------------------
good::string aCmdResults[ good::ELogLevelTotal ] =
{
"Command not found.",
"Command not implemented",
"Sorry, you don't have access to this command.",
"Command error.",
};
const good::string& CTypeToString::ConsoleCommandResultToString( TCommandResult iCmdResult )
{
return EnumToString( iCmdResult-1, ECommandTotal-1, aCmdResults, sUnknown );
}
//----------------------------------------------------------------------------------------------------------------
good::string aLogLevels[good::ELogLevelTotal] =
{
"trace",
"debug",
"info",
"warning",
"error",
"none",
};
int CTypeToString::LogLevelFromString( const good::string& sLevel )
{
return EnumFromString( sLevel, good::ELogLevelTotal, aLogLevels );
}
const good::string& CTypeToString::LogLevelToString( int iLevel )
{
return EnumToString( iLevel, good::ELogLevelTotal, aLogLevels, sUnknown );
}
//----------------------------------------------------------------------------------------------------------------
good::string aStrategyFlags[EFightStrategyFlagTotal] =
{
"run-away-if-near",
"come-closer-if-far",
// "force-stay-far",
// "melee-if-close",
};
int CTypeToString::StrategyFlagsFromString( const good::string& sArg )
{
return FlagsFromString( sArg, EFightStrategyFlagTotal, aStrategyFlags );
}
const good::string& CTypeToString::StrategyFlagsToString( int iArg, bool bUseNone )
{
return FlagsToString( iArg, EFightStrategyFlagTotal, aStrategyFlags, bUseNone );
}
//----------------------------------------------------------------------------------------------------------------
good::string aStrategyArgs[EFightStrategyArgTotal] =
{
"near-distance",
"far-distance",
};
int CTypeToString::StrategyArgFromString( const good::string& sArg )
{
return EnumFromString( sArg, EFightStrategyArgTotal, aStrategyArgs );
}
const good::string& CTypeToString::StrategyArgToString( int iArg )
{
return EnumToString( iArg, EFightStrategyArgTotal, aStrategyArgs, sUnknown );
}
const good::string& CTypeToString::StrategyArgs()
{
return StringArrayToString( aStrategyArgs, EFightStrategyArgTotal );
}
#ifdef BOTRIX_BORZH
//----------------------------------------------------------------------------------------------------------------
// Ordered by TBotAction.
//----------------------------------------------------------------------------------------------------------------
good::string aBotActions[EBotActionTotal] =
{
"MOVE",
"PUSH-BUTTON",
"SHOOT-BUTTON",
"CARRY-BOX",
"CARRY-BOX-FAR",
"DROP-BOX",
"CLIMB-BOX",
"FALL",
};
int CTypeToString::BotActionFromString( const good::string& sAction )
{
return EnumFromString( sAction, EBotActionTotal, aBotActions );
}
const good::string& CTypeToString::BotActionToString( int iAction )
{
return EnumToString( iAction, EBotActionTotal, aBotActions, sUnknown );
}
//----------------------------------------------------------------------------------------------------------------
// Ordered by TBorzhTask.
//----------------------------------------------------------------------------------------------------------------
good::string aBorzhTasks[EBorzhTaskTotal] =
{
"EBorzhTaskWait", ///< Wait for timer to expire. Used during/after talk. Argument is time to wait in msecs.
"EBorzhTaskLook", ///< Look at door/button/box.
"EBorzhTaskMove", ///< Move to given waypoint.
"EBorzhTaskMoveAndCarry", ///< Move to given waypoint carrying a box.
"EBorzhTaskSpeak", ///< Speak about something. Argument represents door/button/box/weapon, etc.
"EBorzhTaskPushButton", ///< Push a button.
"EBorzhTaskWeaponSet", ///< Set current weapon. Argument can be 0xFF for crowbar or CModBorzh::iVarValueWeapon*.
"EBorzhTaskWeaponZoom", ///< Zoom weapon.
"EBorzhTaskWeaponRemoveZoom", ///< Remove zoom from weapon.
"EBorzhTaskWeaponShoot", ///< Shoot weapon.
"EBorzhTaskCarryBox", ///< Start carrying box. Argument is box number.
"EBorzhTaskDropBox", ///< Drop box at needed position in an area. Arguments are box number and area number.
"EBorzhTaskWaitAnswer", ///< Wait for other player to accept/reject task.
"EBorzhTaskWaitPlanner", ///< Wait for planner to finish.
"EBorzhTaskWaitPlayer", ///< Wait for other player to do something. The bot will say "done" phrase when it finishes.
"EBorzhTaskWaitButton", ///< Wait for other player to push a button. The other player must say "i will push button now".
"EBorzhTaskWaitDoor", ///< Wait for other player to check a door. The other player must say "the door is opened/closed".
"EBorzhTaskWaitIndications", ///< Wait for commands of other player.
// Next tasks are tasks that consist of several atomic tasks. Ordered by priority, i.e. explore has higher priority than try button.
"EBorzhTaskButtonTryDoors", ///< Check which doors opens a button. Argument: index is button, type is bool (already pushed or still not).
"EBorzhTaskBringBox", ///< Put box near a wall to climb it.
"EBorzhTaskExplore", ///< Exploring new area.
"EBorzhTaskGoToGoal", ///< Performing go to goal task.
};
const good::string& CTypeToString::BorzhTaskToString( int iTask )
{
return EnumToString( iTask, EBorzhTaskTotal, aBorzhTasks, sUnknown );
}
#endif // BOTRIX_BORZH