Initial Import
[glAntsMech.git] / glants_mech / win32 / glAntsV05 / commands.cpp
blobcf2b452e75b0b404578dc6c0a61d138118fbcc60
1 //
2 // commands.cpp
3 //
4 // The command interface
5 // to have a LaunchCommand
6 //
7 #include <windows.h>
8 #include <stdio.h>
9 #include <stdlib.h>
11 #include <math.h>
13 #include <gl\gl.h> // Header File For The OpenGL32 Library
14 #include <gl\glu.h> // Header File For The GLu32 Library
15 #include <gl\glaux.h> // Header File For The Glaux Library
17 #include "bot.h"
21 // GetStartCommand
23 int GetStartState(int cmd)
25 switch(cmd)
27 case ATTACK_COMMAND:
28 return RECHECK_STATE;
29 break;
31 case WANDER_COMMAND:
32 return MOVE_STATE;
33 break;
35 case MOVE_COMMAND:
36 return GENERATE_STATE;
37 break;
39 default: break;
42 return MOVE_STATE;
43 } // end of the function
47 // GenerateCommand
48 //
50 void Generate_Command(DriverBotPtr bot, int cmd)
53 switch(cmd)
55 case ATTACK_COMMAND:
56 bot->run = Attack_Command;
57 break;
59 case WANDER_COMMAND:
60 bot->run = Wander_Command;
61 break;
63 case MOVE_COMMAND:
64 bot->run = Move_Command;
65 break;
67 default: break;
70 bot->state = GetStartState(cmd);
72 bot->last_command = bot->command;
73 bot->command = cmd;
75 } // end of the function