89 _objects[
object.getType()].push_back(&
object);
97 _objects[
object.getType()].remove(&
object);
105 ObjectMap::const_iterator l =
_objects.find(type);
117 ObjectMap::const_iterator l =
_objects.find(type);
119 return new SearchType(kEmptyObjectList.begin(), kEmptyObjectList.end());
129 return dynamic_cast<Module *
>(object);
133 return dynamic_cast<Area *
>(object);
137 return dynamic_cast<Waypoint *
>(object);
141 return dynamic_cast<Situated *
>(object);
145 return dynamic_cast<Placeable *
>(object);
149 return dynamic_cast<Door *
>(object);
153 return dynamic_cast<Creature *
>(object);
158 if (!pc || !pc->
isPC())
void addObject(KotOR2::Object &object)
Add an object to this container.
A creature in a Star Wars: Knights of the Old Republic II - The Sith Lords area.
bool isPartyMember() const
virtual void getPosition(float &x, float &y, float &z) const
Return the object's position within its area.
std::list< KotOR2::Object * > ::const_iterator iterator
A container of Star Wars: Knights of the Old Republic II - The Sith Lords objects.
float getDistance(KotOR2::Object &a)
SearchList::type ObjectList
bool operator()(KotOR2::Object *a, KotOR2::Object *b)
static Creature * toPartyMember(Aurora::NWScript::Object *object)
SearchRange(const range &r)
The context holding a Star Wars: Knights of the Old Republic II - The Sith Lords area.
::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 removeObject(KotOR2::Object &object)
Remove an object from this container.
A placeable in a Star Wars: Knights of the Old Republic II - The Sith Lords area. ...
A door in a Star Wars: Knights of the Old Republic II - The Sith Lords area.
An object in a Star Wars: Knights of the Old Republic II - The Sith Lords area.
Utility templates and functions.
SearchType(const type &l)
static Creature * toPC(Aurora::NWScript::Object *object)
Low-level type definitions to handle fixed width types portably.
ObjectDistanceSort(const KotOR2::Object &target)
void removeObject(Object &object)
Remove an object from this container.
Object * get()
Return the current object in the search context.
::Aurora::NWScript::Object * getFirstObjectByType(ObjectType type) const
Return the first object of this type.
std::list< KotOR2::Object * > type
The context needed to run a Star Wars: Knights of the Old Republic II - The Sith Lords module...
static Door * toDoor(Aurora::NWScript::Object *object)
static Waypoint * toWaypoint(Aurora::NWScript::Object *object)
A situated object in a Star Wars: Knights of the Old Republic II - The Sith Lords area...
bool isPC() const
Is the creature a player character?
ObjectType
Object type, matches the bitfield in nwscript.nss.
static KotOR2::Object * toObject(::Aurora::NWScript::Object *object)
A waypoint in a Star Wars: Knights of the Old Republic II - The Sith Lords area.
static Area * toArea(Aurora::NWScript::Object *object)
static Situated * toSituated(Aurora::NWScript::Object *object)
::Aurora::NWScript::Object * getObject(const iterator &t)
An area in Star Wars: Knights of the Old Republic II - The Sith Lords, holding all objects and rooms ...
static Module * toModule(Aurora::NWScript::Object *object)
void addObject(Object &object)
Add an object to this container.
static Creature * toCreature(Aurora::NWScript::Object *object)
SearchType(const iterator &a, const iterator &b)