00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00014 00015 #pragma warning (disable:4996) 00016 #pragma warning (disable:4005) 00017 #pragma warning(disable:4275) 00018 00019 00020 #ifndef _AIWORLD_H 00021 #define _AIWORLD_H 00022 00023 #include "globals.h" 00024 #include "aiCharacter.h" 00025 #include "flock.h" 00026 00027 class AICharacter; 00028 class Flock; 00029 00036 00038 00039 00040 class AICharPool { 00041 public: 00042 struct node { 00043 AICharacter * _ai_char; 00044 node * _next; 00045 } ; 00046 00047 node* _head; 00048 AICharPool(); 00049 ~AICharPool(); 00050 void append(AICharacter *ai_ch); 00051 void del(string name); 00052 void print_list(); 00053 }; 00054 00055 00064 00066 00067 00068 class AIWorld { 00069 private: 00070 AICharPool * _ai_char_pool; 00071 NodePath _render; 00072 public: 00073 vector<NodePath> _obstacles; 00074 typedef std::vector<Flock*> FlockPool; 00075 FlockPool _flock_pool; 00076 void remove_ai_char_from_flock(string name); 00077 00078 PUBLISHED: 00079 AIWorld(NodePath render); 00080 ~AIWorld(); 00081 00082 void add_ai_char(AICharacter *ai_ch); 00083 void remove_ai_char(string name); 00084 00085 void add_flock(Flock *flock); 00086 void flock_off(unsigned int flock_id); 00087 void flock_on(unsigned int flock_id); 00088 void remove_flock(unsigned int flock_id); 00089 Flock get_flock(unsigned int flock_id); 00090 00091 void add_obstacle(NodePath obstacle); 00092 void remove_obstacle(NodePath obstacle); 00093 00094 void print_list(); 00095 void update(); 00096 }; 00097 00098 #endif 00099 00100 00101 00102 00103 00104 00105 00106 00107