xoreos  0.0.5
Public Member Functions | Protected Attributes | List of all members
Engines::Witcher::Object Class Reference

An object within a Witcher area. More...

#include <object.h>

Inheritance diagram for Engines::Witcher::Object:
Inheritance graph
[legend]
Collaboration diagram for Engines::Witcher::Object:
Collaboration graph
[legend]

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::UStringgetUniqueID () const
 Return the object's globally unique ID. More...
 
const Aurora::LocStringgetName () const
 Return the object's name. More...
 
const Aurora::LocStringgetDescription () const
 Return the object's description. More...
 
const Common::UStringgetConversation () 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...
 
AreagetArea () 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::UStringgetTag () const
 
- Public Member Functions inherited from Aurora::NWScript::VariableContainer
 VariableContainer ()
 
virtual ~VariableContainer ()
 
bool hasVariable (const Common::UString &var) const
 
VariablegetVariable (const Common::UString &var, Type type=kTypeVoid)
 
const VariablegetVariable (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::UStringgetScript (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)
 

Detailed Description

An object within a Witcher area.

Definition at line 51 of file object.h.

Constructor & Destructor Documentation

◆ Object()

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.

Here is the call graph for this function:

◆ ~Object()

Engines::Witcher::Object::~Object ( )
virtual

Reimplemented from Aurora::NWScript::Object.

Definition at line 57 of file object.cpp.

References ObjectMan.

Member Function Documentation

◆ click()

bool Engines::Witcher::Object::click ( Object triggerer = 0)
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().

Here is the caller graph for this function:

◆ enter()

void Engines::Witcher::Object::enter ( )
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().

Here is the caller graph for this function:

◆ getArea()

Area * Engines::Witcher::Object::getArea ( ) const

◆ getConversation()

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.

◆ getDescription()

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().

Here is the caller graph for this function:

◆ getIDs()

const std::list< uint32 > & Engines::Witcher::Object::getIDs ( ) const

Return the object's model IDs.

Definition at line 108 of file object.cpp.

References _ids.

◆ getLocation()

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().

Here is the call graph for this function:

◆ getName()

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().

Here is the caller graph for this function:

◆ getOrientation()

void Engines::Witcher::Object::getOrientation ( float &  x,
float &  y,
float &  z,
float &  angle 
) const
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().

Here is the caller graph for this function:

◆ getPosition()

void Engines::Witcher::Object::getPosition ( float &  x,
float &  y,
float &  z 
) const
virtual

◆ getType()

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().

Here is the caller graph for this function:

◆ getUniqueID()

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.

◆ hide()

void Engines::Witcher::Object::hide ( )
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().

Here is the caller graph for this function:

◆ highlight()

void Engines::Witcher::Object::highlight ( bool  enabled)
virtual

(Un)Highlight the object.

Reimplemented in Engines::Witcher::Placeable, and Engines::Witcher::Door.

Definition at line 165 of file object.cpp.

◆ isClickable()

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().

Here is the caller graph for this function:

◆ isStatic()

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().

Here is the caller graph for this function:

◆ isUsable()

bool Engines::Witcher::Object::isUsable ( ) const

Can the object be used by the PC?

Definition at line 100 of file object.cpp.

References _usable.

◆ leave()

void Engines::Witcher::Object::leave ( )
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().

Here is the caller graph for this function:

◆ loadModel()

void Engines::Witcher::Object::loadModel ( )
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().

Here is the caller graph for this function:

◆ playSound()

void Engines::Witcher::Object::playSound ( const Common::UString sound,
bool  pitchVariance = false 
)

◆ refreshLocalized()

void Engines::Witcher::Object::refreshLocalized ( )
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().

Here is the caller graph for this function:

◆ setArea()

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().

Here is the caller graph for this function:

◆ setOrientation()

void Engines::Witcher::Object::setOrientation ( float  x,
float  y,
float  z,
float  angle 
)
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().

Here is the caller graph for this function:

◆ setPosition()

void Engines::Witcher::Object::setPosition ( float  x,
float  y,
float  z 
)
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().

Here is the caller graph for this function:

◆ show()

void Engines::Witcher::Object::show ( )
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().

Here is the caller graph for this function:

◆ speakOneLiner()

void Engines::Witcher::Object::speakOneLiner ( Common::UString  conv,
Object tokenTarget = 0 
)

◆ speakString()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopSound()

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().

Here is the caller graph for this function:

◆ unloadModel()

void Engines::Witcher::Object::unloadModel ( )
virtual

Unload the object's model(s).

Reimplemented in Engines::Witcher::Situated.

Definition at line 68 of file object.cpp.

Member Data Documentation

◆ _area

Area* Engines::Witcher::Object::_area
protected

The area the object is currently in.

Definition at line 156 of file object.h.

Referenced by getArea(), getLocation(), and setArea().

◆ _conversation

Common::UString Engines::Witcher::Object::_conversation
protected

The object's default conversation.

Definition at line 149 of file object.h.

Referenced by getConversation(), Engines::Witcher::Situated::loadProperties(), and speakOneLiner().

◆ _description

Aurora::LocString Engines::Witcher::Object::_description
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().

◆ _ids

std::list<uint32> Engines::Witcher::Object::_ids
protected

The object's model IDs.

Definition at line 154 of file object.h.

Referenced by getIDs(), and Engines::Witcher::Situated::loadModel().

◆ _name

Aurora::LocString Engines::Witcher::Object::_name
protected

◆ _orientation

float Engines::Witcher::Object::_orientation[4]
protected

The object's orientation.

Definition at line 159 of file object.h.

Referenced by getOrientation(), Object(), and setOrientation().

◆ _position

float Engines::Witcher::Object::_position[3]
protected

The object's position.

Definition at line 158 of file object.h.

Referenced by getLocation(), getPosition(), Object(), and setPosition().

◆ _sound

Sound::ChannelHandle Engines::Witcher::Object::_sound
protected

The currently playing object sound.

Definition at line 161 of file object.h.

Referenced by playSound(), and stopSound().

◆ _static

bool Engines::Witcher::Object::_static
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().

◆ _type

ObjectType Engines::Witcher::Object::_type
protected

The object's type.

Definition at line 142 of file object.h.

Referenced by getType().

◆ _uniqueID

Common::UString Engines::Witcher::Object::_uniqueID
protected

◆ _usable

bool Engines::Witcher::Object::_usable
protected

Is the object usable?

Definition at line 152 of file object.h.

Referenced by isClickable(), isUsable(), and Engines::Witcher::Situated::loadProperties().


The documentation for this class was generated from the following files: