26#ifndef SAGA2_PROPERTY_H
27#define SAGA2_PROPERTY_H
49 virtual bool operator()(T *obj)
const = 0;
65 bool (*_propertyFunc)(T *);
74 bool operator()(T *obj)
const;
80 return (*_propertyFunc)(obj);
117 assert(_propertyArray);
120 memcpy(_propertyArray, array, arrayBytes);
126CompoundProperty< T >::~CompoundProperty() {
128 free(_propertyArray);
147 bool operator()(T *obj)
const;
157 for (i = 0; i < arraySize; i++)
158 if ((*propertyArray[i])(obj) ==
false)
return false;
181 bool operator()(T *obj)
const;
191 for (i = 0; i < arraySize; i++)
192 if ((*propertyArray[i])(obj))
return true;
205typedef Property< GameObject > ObjectProperty;
206typedef SimpleProperty< GameObject > SimpleObjectProperty;
207typedef PropertyAnd< GameObject > ObjectPropertyAnd;
208typedef PropertyOr< GameObject > ObjectPropertyOr;
210typedef int16 ObjectPropertyID;
219 kObjPropIDPlayerActor,
231typedef Property< Actor > ActorProperty;
232typedef SimpleProperty< Actor > SimpleActorProperty;
233typedef PropertyAnd< Actor > ActorPropertyAnd;
234typedef PropertyOr< Actor > ActorPropertyOr;
236typedef int16 ActorPropertyID;
240 kActorPropIDCenterActor,
241 kActorPropIDPlayerActor,
253typedef Property< TileInfo > TileProperty;
254typedef SimpleProperty< TileInfo > SimpleTileProperty;
255typedef PropertyAnd< TileInfo > TilePropertyAnd;
256typedef PropertyOr< TileInfo > TilePropertyOr;
258typedef int16 TilePropertyID;
287 virtual bool operator()(
304 _propertyFunc(func) {
367typedef int16 MetaTilePropertyID;
370 kMetaTilePropIDHasWater,
375bool objIsObject(GameObject *obj);
377bool objIsActor(GameObject *obj);
379bool objIsWorld(GameObject *obj);
381bool objIsLocked(GameObject *obj);
383bool objIsUnlocked(GameObject *obj);
385bool objIsKey(GameObject *obj);
387bool objIsPlayerActor(GameObject *obj);
389bool objIsEnemy(GameObject *obj);
391bool actorIsDead(Actor *a);
393bool actorIsCenterActor(Actor *a);
395bool actorIsPlayerActor(Actor *a);
397bool actorIsEnemy(Actor *a);
399bool tileHasWater(TileInfo *ti);
401bool metaTileHasWater(MetaTile *mt, int16 mapNum,
const TilePoint &mCoords);
416 return _objPropArray[id];
420 return _actorPropArray[id];
424 return _tilePropArray[id];
428 return _metaTilePropArray[id];
Definition: property.h:93
Definition: property.h:403
Definition: property.h:140
Definition: property.h:45
Definition: property.h:174
Definition: property.h:64
void warning(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Definition: tcoords.h:127