bsp
ent.h
00001 #ifndef _ENT_H_
00002 #define _ENT_H_
00003 
00004 class map;
00005 
00006 typedef struct epair_s
00007 {
00008     struct epair_s      *next;
00009     char        key[MAX_KEY];
00010     char        value[MAX_VALUE];
00011 } epair_t;
00012 
00013 // an Entity is a list of brush objects, with additional key / value info
00014 
00015 class map;
00016 class EntityClass;
00017 
00018 class Entity
00019 {
00020 public:
00021 
00022     Entity *p_prev, *p_next;
00023 
00024     bool invalid;
00025     int group;
00026     bool modifiable;
00027     EntityClass *ec;
00028 
00029     int count;
00030     SetBrush objects;
00031     map *owner;
00032 
00033     vec3_t origin;
00034 
00035     epair_t     *epairs;
00036 
00037     Entity *undoCameFrom;
00038 
00039     //CACHE - for common key types
00040     char *classname;
00041     char *targetname;
00042     char *target;
00043     char *angle;
00044 
00045 // METHODS
00046     Entity();
00047     ~Entity();
00048 
00049     Entity *undoCopy();
00050     Entity *undoCopyNoBrushes();
00051 
00052 //   void OriginRebuild(bool);
00053 
00054     void freeObjects(int killtoo);
00055     void addObject(SetBrush *);
00056     void removeObject(SetBrush *);
00057 
00058     bool lookForBrush(SetBrush *b);
00059     void appendList(Entity *e);
00060     Entity *copy();
00061     void empty();
00062 //         SetBrush *objectAt(int i);
00063     int numPairs();
00064     void freeAll();
00065     void initClass(char *classname);
00066     int initFromTokens(map *parent, Tokenizer &script);
00067     void setModifiable(bool m);
00068     char *get_targetname();
00069     void writeToFILE(FILE *f,int,int, map *);
00070     char *valueForQKey(char *k);
00071     void getVector(vec3_t v, char *k);
00072     void setKey(char *k,char *v);
00073     void removeKeyPair(char *key);
00074     void setOriginKey();
00075     SetBrush *createFixedBrush(vec3_t org);
00076 };
00077 
00078 #endif  //_ENT_H_
00079 
 All Classes Functions