90 _objects[
object.getType()].push_back(&
object);
98 _objects[
object.getType()].remove(&
object);
106 ObjectMap::const_iterator l =
_objects.find(type);
118 ObjectMap::const_iterator l =
_objects.find(type);
120 return new SearchType(kEmptyObjectList.begin(), kEmptyObjectList.end());
130 return dynamic_cast<Module *
>(object);
134 return dynamic_cast<Area *
>(object);
138 return dynamic_cast<Waypoint *
>(object);
142 return dynamic_cast<Situated *
>(object);
146 return dynamic_cast<Placeable *
>(object);
150 return dynamic_cast<Door *
>(object);
154 return dynamic_cast<Creature *
>(object);
159 if (!pc || !pc->
isPC())
166 return dynamic_cast<Location *
>(engineType);
static NWN2::Object * toObject(::Aurora::NWScript::Object *object)
std::list< NWN2::Object * > ::const_iterator iterator
An area in Neverwinter Nights 2, holding all objects, room tiles and terrain within, as well as general area properties like the current background music and ambient sounds.
SearchList::type ObjectList
The context holding a Neverwinter Nights 2 area.
SearchType(const type &l)
A location within a Neverwinter Nights 2 area.
static Creature * toCreature(Aurora::NWScript::Object *object)
float getDistance(NWN2::Object &a)
SearchRange(const range &r)
An object within a NWN2 area.
The context needed to run a Neverwinter Nights 2 module.
A creature in a Neverwinter Nights 2 area.
A container of Neverwinter Nights 2 objects.
void removeObject(NWN2::Object &object)
Remove an object from this container.
Utility templates and functions.
SearchType(const iterator &a, const iterator &b)
static Location * toLocation(Aurora::NWScript::EngineType *engineType)
static Situated * toSituated(Aurora::NWScript::Object *object)
static Module * toModule(Aurora::NWScript::Object *object)
::Aurora::NWScript::ObjectSearch * findObjectsByType(ObjectType type) const
Return a search context to iterate over all objects of this type.
static Placeable * toPlaceable(Aurora::NWScript::Object *object)
void addObject(NWN2::Object &object)
Add an object to this container.
bool operator()(NWN2::Object *a, NWN2::Object *b)
Low-level type definitions to handle fixed width types portably.
::Aurora::NWScript::Object * getFirstObjectByType(ObjectType type) const
Return the first object of this type.
void removeObject(Object &object)
Remove an object from this container.
Object * get()
Return the current object in the search context.
std::list< NWN2::Object * > type
bool isPC() const
Is the creature a player character?
::Aurora::NWScript::Object * getObject(const iterator &t)
A situated object in a Neverwinter Nights 2 area.
A door in a Neverwinter Nights 2 area.
static Door * toDoor(Aurora::NWScript::Object *object)
A placeable object in a Neverwinter Nights 2 area.
virtual void getPosition(float &x, float &y, float &z) const
Return the object's position within its area.
An object in a Neverwinter Nights 2 area.
ObjectType
Object type, matches the bitfield in nwscript.nss.
ObjectDistanceSort(const NWN2::Object &target)
static Area * toArea(Aurora::NWScript::Object *object)
static Creature * toPC(Aurora::NWScript::Object *object)
void addObject(Object &object)
Add an object to this container.
A waypoint in a Neverwinter Nights 2 area.
static Waypoint * toWaypoint(Aurora::NWScript::Object *object)