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