2010-09-01 10:37:10 +00:00
|
|
|
#ifndef Entity_h
|
|
|
|
#define Entity_h
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-09 11:46:38 +00:00
|
|
|
#include <AppKit/AppKit.h>
|
|
|
|
|
|
|
|
#include "QF/mathlib.h"
|
2010-12-27 03:11:07 +00:00
|
|
|
#include "QF/quakeio.h"
|
2010-09-09 11:46:38 +00:00
|
|
|
|
2010-09-29 20:09:11 +00:00
|
|
|
typedef struct epair_s {
|
|
|
|
struct epair_s *next;
|
2011-04-09 05:34:27 +00:00
|
|
|
struct epair_s **prev;
|
2010-09-29 20:09:11 +00:00
|
|
|
char *key;
|
|
|
|
char *value;
|
2003-03-18 19:48:24 +00:00
|
|
|
} epair_t;
|
|
|
|
|
|
|
|
// an Entity is a list of brush objects, with additional key / value info
|
|
|
|
|
2010-09-29 20:09:11 +00:00
|
|
|
@interface Entity: NSMutableArray
|
2010-09-11 16:41:18 +00:00
|
|
|
{
|
2010-09-29 20:09:11 +00:00
|
|
|
NSMutableArray *array;
|
|
|
|
epair_t *epairs;
|
2011-04-09 05:34:27 +00:00
|
|
|
struct hashtab_s *epair_tab;
|
2010-09-29 20:09:11 +00:00
|
|
|
BOOL modifiable;
|
2003-03-18 19:48:24 +00:00
|
|
|
}
|
|
|
|
|
2010-09-29 20:09:11 +00:00
|
|
|
- (Entity *) initClass: (const char *)classname;
|
|
|
|
- (Entity *) initFromScript: (struct script_s *)script;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-28 19:43:35 +00:00
|
|
|
- (oneway void) dealloc;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-29 20:09:11 +00:00
|
|
|
- (BOOL) modifiable;
|
|
|
|
- (void) setModifiable: (BOOL)m;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-29 20:09:11 +00:00
|
|
|
- (const char *) targetname;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-12-27 03:11:07 +00:00
|
|
|
- (void) writeToFile: (QFile *)file region: (BOOL)reg;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-29 20:09:11 +00:00
|
|
|
- (const char *) valueForQKey: (const char *)k;
|
|
|
|
- (void) getVector: (vec3_t)v forKey: (const char *)k;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-29 20:09:11 +00:00
|
|
|
- (void) setKey: (const char *)k
|
|
|
|
toValue: (const char *)v;
|
2010-09-11 10:06:04 +00:00
|
|
|
|
2010-09-29 20:09:11 +00:00
|
|
|
- (int) numPairs;
|
|
|
|
- (epair_t *) epairs;
|
|
|
|
- (void) removeKeyPair: (const char *)key;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
@end
|
|
|
|
#endif // Entity_h
|