xoreos
0.0.5
|
An object within a Witcher area. More...
#include <object.h>
Public Member Functions | |
Object (ObjectType type=kObjectTypeInvalid) | |
virtual | ~Object () |
ObjectType | getType () const |
Return the exact type of the object. More... | |
virtual void | refreshLocalized () |
Refresh all localized strings. More... | |
virtual void | loadModel () |
Load the object's model(s). More... | |
virtual void | unloadModel () |
Unload the object's model(s). More... | |
virtual void | show () |
Show the object's model(s). More... | |
virtual void | hide () |
Hide the object's model(s). More... | |
const std::list< uint32 > & | getIDs () const |
Return the object's model IDs. More... | |
const Common::UString & | getUniqueID () const |
Return the object's globally unique ID. More... | |
const Aurora::LocString & | getName () const |
Return the object's name. More... | |
const Aurora::LocString & | getDescription () const |
Return the object's description. More... | |
const Common::UString & | getConversation () const |
Return the object's default conversation (DLG). More... | |
bool | isStatic () const |
Is the object static (not manipulable at all)? More... | |
bool | isUsable () const |
Can the object be used by the PC? More... | |
bool | isClickable () const |
Can the player click the object? More... | |
Area * | getArea () const |
Return the area this object is currently in. More... | |
void | setArea (Area *) |
Set the area this object is currently in. More... | |
virtual void | getPosition (float &x, float &y, float &z) const |
Return the object's position within its area. More... | |
virtual void | getOrientation (float &x, float &y, float &z, float &angle) const |
Return the object's orientation. More... | |
virtual void | setPosition (float x, float y, float z) |
Set the object's position within its area. More... | |
virtual void | setOrientation (float x, float y, float z, float angle) |
Set the object's orientation. More... | |
Location | getLocation () const |
Create a Location out of the object's area, position and orientation. More... | |
virtual void | enter () |
The cursor entered the object. More... | |
virtual void | leave () |
The cursor left the object. More... | |
virtual void | highlight (bool enabled) |
(Un)Highlight the object. More... | |
virtual bool | click (Object *triggerer=0) |
The object was clicked. More... | |
void | speakString (const Common::UString &string, uint32 volume) |
Speak the specified string. More... | |
void | speakOneLiner (Common::UString conv, Object *tokenTarget=0) |
Speak an one-liner from the specified conversation file. More... | |
void | stopSound () |
Stop the current object sound. More... | |
void | playSound (const Common::UString &sound, bool pitchVariance=false) |
Play an object sound. More... | |
Public Member Functions inherited from Aurora::NWScript::Object | |
Object () | |
uint32 | getID () const |
const Common::UString & | getTag () const |
Public Member Functions inherited from Aurora::NWScript::VariableContainer | |
VariableContainer () | |
virtual | ~VariableContainer () |
bool | hasVariable (const Common::UString &var) const |
Variable & | getVariable (const Common::UString &var, Type type=kTypeVoid) |
const Variable & | getVariable (const Common::UString &var) const |
void | setVariable (const Common::UString &var, const Variable &value) |
void | removeVariable (const Common::UString &var) |
void | clearVariables () |
Public Member Functions inherited from Engines::Witcher::ScriptContainer | |
ScriptContainer () | |
~ScriptContainer () | |
const Common::UString & | getScript (Script script) const |
bool | hasScript (Script script) const |
bool | runScript (Script script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference()) |
Protected Attributes | |
ObjectType | _type |
The object's type. More... | |
Common::UString | _uniqueID |
A globally unique ID. More... | |
Aurora::LocString | _name |
The object's name. More... | |
Aurora::LocString | _description |
The object's description. More... | |
Common::UString | _conversation |
The object's default conversation. More... | |
bool | _static |
Is the object static? More... | |
bool | _usable |
Is the object usable? More... | |
std::list< uint32 > | _ids |
The object's model IDs. More... | |
Area * | _area |
The area the object is currently in. More... | |
float | _position [3] |
The object's position. More... | |
float | _orientation [4] |
The object's orientation. More... | |
Sound::ChannelHandle | _sound |
The currently playing object sound. More... | |
Protected Attributes inherited from Aurora::NWScript::Object | |
uint32 | _id |
Common::UString | _tag |
Additional Inherited Members | |
Static Public Member Functions inherited from Engines::Witcher::ScriptContainer | |
static bool | runScript (const Common::UString &script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference()) |
static bool | runScript (const Common::UString &script, const Aurora::NWScript::ScriptState &state, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference()) |
Protected Member Functions inherited from Engines::Witcher::ScriptContainer | |
void | clearScripts () |
void | readScripts (const Aurora::GFF3Struct &gff) |
void | readScripts (const ScriptContainer &container) |
Engines::Witcher::Object::Object | ( | ObjectType | type = kObjectTypeInvalid | ) |
Definition at line 43 of file object.cpp.
References Aurora::NWScript::Object::_id, _orientation, _position, Common::generateIDNumber(), and ObjectMan.
|
virtual |
Reimplemented from Aurora::NWScript::Object.
Definition at line 57 of file object.cpp.
References ObjectMan.
|
virtual |
The object was clicked.
Reimplemented in Engines::Witcher::Placeable, and Engines::Witcher::Door.
Definition at line 215 of file object.cpp.
Referenced by Engines::Witcher::Area::click().
|
virtual |
The cursor entered the object.
Reimplemented in Engines::Witcher::Placeable, and Engines::Witcher::Door.
Definition at line 159 of file object.cpp.
Referenced by Engines::Witcher::Module::replaceModule(), and Engines::Witcher::Area::setActive().
Area * Engines::Witcher::Object::getArea | ( | ) | const |
Return the area this object is currently in.
Definition at line 112 of file object.cpp.
References _area.
Referenced by Engines::Witcher::Functions::getArea(), Engines::Witcher::Functions::getNearestCreature(), Engines::Witcher::Functions::getNearestObject(), Engines::Witcher::Functions::getNearestObjectByTag(), Engines::Witcher::Module::getObjectLocation(), Engines::Witcher::Functions::jumpTo(), and Engines::Witcher::Module::movedPC().
const Common::UString & Engines::Witcher::Object::getConversation | ( | ) | const |
Return the object's default conversation (DLG).
Definition at line 89 of file object.cpp.
References _conversation.
const Aurora::LocString & Engines::Witcher::Object::getDescription | ( | ) | const |
Return the object's description.
Definition at line 85 of file object.cpp.
References _description.
Referenced by Engines::Witcher::Module::getDescription().
const std::list< uint32 > & Engines::Witcher::Object::getIDs | ( | ) | const |
Location Engines::Witcher::Object::getLocation | ( | ) | const |
Create a Location out of the object's area, position and orientation.
Definition at line 120 of file object.cpp.
References _area, _position, Engines::Witcher::Location::setArea(), Engines::Witcher::Location::setFacing(), and Engines::Witcher::Location::setPosition().
const Aurora::LocString & Engines::Witcher::Object::getName | ( | ) | const |
Return the object's name.
Definition at line 81 of file object.cpp.
References _name.
Referenced by Engines::Witcher::Module::enter(), Engines::Witcher::Module::getName(), Engines::Witcher::Area::getName(), Engines::Witcher::Functions::sendMessageToPC(), and speakString().
|
virtual |
Return the object's orientation.
Definition at line 138 of file object.cpp.
References _orientation.
Referenced by Engines::Witcher::Situated::loadModel(), and Engines::Witcher::Situated::setOrientation().
|
virtual |
Return the object's position within its area.
Definition at line 132 of file object.cpp.
References _position.
Referenced by Engines::Witcher::ObjectDistanceSort::getDistance(), Engines::Witcher::Functions::getDistanceToObject(), Engines::Witcher::Module::getObjectLocation(), Engines::Witcher::Situated::loadModel(), Engines::Witcher::Module::movedPC(), Engines::Witcher::Module::movePC(), Engines::Witcher::ObjectDistanceSort::ObjectDistanceSort(), and Engines::Witcher::Situated::setPosition().
ObjectType Engines::Witcher::Object::getType | ( | ) | const |
Return the exact type of the object.
Definition at line 61 of file object.cpp.
References _type.
Referenced by Engines::Witcher::Functions::getNearestObject(), Engines::Witcher::Module::getObjectLocation(), Engines::Witcher::Functions::getObjectType(), and Engines::Witcher::Functions::getParamObject().
const Common::UString & Engines::Witcher::Object::getUniqueID | ( | ) | const |
Return the object's globally unique ID.
Definition at line 77 of file object.cpp.
References _uniqueID.
|
virtual |
Hide the object's model(s).
Reimplemented in Engines::Witcher::Area, Engines::Witcher::Door, Engines::Witcher::Placeable, and Engines::Witcher::Situated.
Definition at line 74 of file object.cpp.
Referenced by Engines::Witcher::Module::enterArea(), Engines::Witcher::Module::unloadPC(), and Engines::Witcher::Waypoint::~Waypoint().
|
virtual |
(Un)Highlight the object.
Reimplemented in Engines::Witcher::Placeable, and Engines::Witcher::Door.
Definition at line 165 of file object.cpp.
bool Engines::Witcher::Object::isClickable | ( | ) | const |
Can the player click the object?
Definition at line 104 of file object.cpp.
References _static, and _usable.
Referenced by Engines::Witcher::Situated::loadModel().
bool Engines::Witcher::Object::isStatic | ( | ) | const |
Is the object static (not manipulable at all)?
Definition at line 96 of file object.cpp.
References _static.
Referenced by Engines::Witcher::Area::loadModels().
bool Engines::Witcher::Object::isUsable | ( | ) | const |
|
virtual |
The cursor left the object.
Reimplemented in Engines::Witcher::Module, Engines::Witcher::Placeable, and Engines::Witcher::Door.
Definition at line 162 of file object.cpp.
Referenced by Engines::Witcher::Area::removeFocus(), and Engines::Witcher::Area::setActive().
|
virtual |
Load the object's model(s).
Reimplemented in Engines::Witcher::Situated.
Definition at line 65 of file object.cpp.
Referenced by Engines::Witcher::Module::enter(), and Engines::Witcher::Area::loadModels().
void Engines::Witcher::Object::playSound | ( | const Common::UString & | sound, |
bool | pitchVariance = false |
||
) |
Play an object sound.
Definition at line 207 of file object.cpp.
References _sound, Common::UString::empty(), Sound::kSoundTypeVoice, Engines::playSound(), and stopSound().
Referenced by Engines::Witcher::Placeable::activate(), Engines::Witcher::Placeable::click(), Engines::Witcher::Door::close(), Engines::Witcher::Placeable::close(), Engines::Witcher::Placeable::deactivate(), Engines::Witcher::Door::open(), Engines::Witcher::Placeable::open(), Engines::Witcher::Functions::playSound(), and speakOneLiner().
|
virtual |
Refresh all localized strings.
Reimplemented in Engines::Witcher::Module, Engines::Witcher::Area, and Engines::Witcher::Waypoint.
Definition at line 93 of file object.cpp.
Referenced by Engines::Witcher::Situated::loadProperties(), and Engines::Witcher::Waypoint::refreshLocalized().
void Engines::Witcher::Object::setArea | ( | Area * | area | ) |
Set the area this object is currently in.
Definition at line 116 of file object.cpp.
References _area.
Referenced by Engines::Witcher::Module::enterArea(), and Engines::Witcher::Module::movePC().
|
virtual |
Set the object's orientation.
Reimplemented in Engines::Witcher::Situated.
Definition at line 152 of file object.cpp.
References _orientation.
Referenced by Engines::Witcher::Module::enter(), Engines::Witcher::Waypoint::load(), and Engines::Witcher::Situated::setOrientation().
|
virtual |
Set the object's position within its area.
Reimplemented in Engines::Witcher::Situated.
Definition at line 146 of file object.cpp.
References _position.
Referenced by Engines::Witcher::Module::enter(), Engines::Witcher::Waypoint::load(), Engines::Witcher::Module::movePC(), and Engines::Witcher::Situated::setPosition().
|
virtual |
Show the object's model(s).
Reimplemented in Engines::Witcher::Area, Engines::Witcher::Door, Engines::Witcher::Placeable, and Engines::Witcher::Situated.
Definition at line 71 of file object.cpp.
Referenced by Engines::Witcher::Module::enterArea().
void Engines::Witcher::Object::speakOneLiner | ( | Common::UString | conv, |
Object * | tokenTarget = 0 |
||
) |
Speak an one-liner from the specified conversation file.
Definition at line 174 of file object.cpp.
References _conversation, Common::UString::c_str(), Common::UString::empty(), Common::exceptionDispatcherWarning(), Aurora::DLGFile::getOneLiner(), Aurora::LocString::getString(), playSound(), Aurora::DLGFile::Line::sound, speakString(), and Aurora::DLGFile::Line::text.
void Engines::Witcher::Object::speakString | ( | const Common::UString & | string, |
uint32 | volume | ||
) |
Speak the specified string.
Definition at line 168 of file object.cpp.
References getName(), and status().
Referenced by Engines::Witcher::Functions::actionSpeakString(), speakOneLiner(), and Engines::Witcher::Functions::speakString().
void Engines::Witcher::Object::stopSound | ( | ) |
Stop the current object sound.
Definition at line 203 of file object.cpp.
References _sound, and SoundMan.
Referenced by playSound().
|
virtual |
Unload the object's model(s).
Reimplemented in Engines::Witcher::Situated.
Definition at line 68 of file object.cpp.
|
protected |
The area the object is currently in.
Definition at line 156 of file object.h.
Referenced by getArea(), getLocation(), and setArea().
|
protected |
The object's default conversation.
Definition at line 149 of file object.h.
Referenced by getConversation(), Engines::Witcher::Situated::loadProperties(), and speakOneLiner().
|
protected |
The object's description.
Definition at line 147 of file object.h.
Referenced by getDescription(), Engines::Witcher::Creature::load(), and Engines::Witcher::Situated::loadProperties().
|
protected |
The object's model IDs.
Definition at line 154 of file object.h.
Referenced by getIDs(), and Engines::Witcher::Situated::loadModel().
|
protected |
The object's name.
Definition at line 146 of file object.h.
Referenced by Engines::Witcher::Module::enter(), getName(), Engines::Witcher::Creature::load(), Engines::Witcher::Area::loadARE(), Engines::Witcher::Situated::loadModel(), Engines::Witcher::Module::loadModule(), and Engines::Witcher::Situated::loadProperties().
|
protected |
The object's orientation.
Definition at line 159 of file object.h.
Referenced by getOrientation(), Object(), and setOrientation().
|
protected |
The object's position.
Definition at line 158 of file object.h.
Referenced by getLocation(), getPosition(), Object(), and setPosition().
|
protected |
The currently playing object sound.
Definition at line 161 of file object.h.
Referenced by playSound(), and stopSound().
|
protected |
Is the object static?
Definition at line 151 of file object.h.
Referenced by isClickable(), isStatic(), Engines::Witcher::Creature::load(), and Engines::Witcher::Situated::loadProperties().
|
protected |
|
protected |
A globally unique ID.
Definition at line 144 of file object.h.
Referenced by getUniqueID(), Engines::Witcher::Creature::load(), Engines::Witcher::Waypoint::loadProperties(), and Engines::Witcher::Situated::loadProperties().
|
protected |
Is the object usable?
Definition at line 152 of file object.h.
Referenced by isClickable(), isUsable(), and Engines::Witcher::Situated::loadProperties().