xoreos  0.0.5
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
Engines::NWN::Situated Class Referenceabstract

#include <situated.h>

Inheritance diagram for Engines::NWN::Situated:
Inheritance graph
[legend]
Collaboration diagram for Engines::NWN::Situated:
Collaboration graph
[legend]

Public Member Functions

 ~Situated ()
 
void loadModel ()
 Load the situated object's model. More...
 
void unloadModel ()
 Unload the situated object's model. More...
 
void show ()
 Show the situated object's model. More...
 
void hide ()
 Hide the situated object's model. More...
 
virtual bool isOpen () const =0
 Is the situated object open? More...
 
bool isLocked () const
 Is the situated object locked? More...
 
virtual void setLocked (bool locked)
 Lock/Unlock the situated object. More...
 
ObjectgetLastOpenedBy () const
 Return the object that last opened this situated object. More...
 
ObjectgetLastClosedBy () const
 Return the object that last closed this situated object. More...
 
ObjectgetLastUsedBy () const
 Return the object that last used this situated object. More...
 
void setPosition (float x, float y, float z)
 Set the situated object's position. More...
 
void setOrientation (float x, float y, float z, float angle)
 Set the situated object's orientation. More...
 
- Public Member Functions inherited from Engines::NWN::Object
 Object (ObjectType type=kObjectTypeInvalid)
 
virtual ~Object ()
 
ObjectType getType () const
 Return the exact type of the object. More...
 
const std::list< uint32 > & getIDs () const
 Return the object's model IDs. More...
 
const Common::UStringgetName () const
 Return the object's name. More...
 
const Common::UStringgetDescription () const
 Return the object's description. More...
 
const Common::UStringgetPortrait () const
 Return the object's portrait. More...
 
const Common::UStringgetConversation () const
 Return the object's default conversation (DLG). More...
 
const Aurora::SSFFilegetSSF ()
 Return the object's sound set. 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...
 
Aurora::NWScript::ObjectgetPCSpeaker () const
 Return the PC currently speaking with this object. More...
 
void setPCSpeaker (Aurora::NWScript::Object *pc)
 Set the PC currently speaking with this object. More...
 
AreagetArea () const
 Return the area this object is currently in. More...
 
virtual 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...
 
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...
 
virtual 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...
 
virtual void playAnimation (const Common::UString &animation="", bool restart=true, float length=0.0f, float speed=1.0f)
 Play an object animation. More...
 
virtual void playAnimation (Animation animation, bool restart=true, float length=0.0f, float speed=1.0f)
 Play a default object animation. 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::NWN::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 Member Functions

 Situated (ObjectType type)
 
void load (const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint=0)
 Load the situated object from an instance and its blueprint. More...
 
virtual void loadObject (const Aurora::GFF3Struct &gff)=0
 Load object-specific properties. More...
 
virtual void loadAppearance ()=0
 Load appearance-specific properties. More...
 
- Protected Member Functions inherited from Engines::NWN::Object
void loadSSF ()
 Load the object's sound set. More...
 
bool beginConversation (Object *triggerer)
 Begin a conversation between the triggerer and this object. More...
 
bool createFeedbackTooltip ()
 Create a tooltip with the name and/or portrait of the object. More...
 
bool createSpeechTooltip (const Common::UString &line)
 Create a tooltip with a line the object should speak. More...
 
void destroyTooltip ()
 Destroy all tooltips on this object. More...
 
bool showFeedbackTooltip ()
 Create and show a tooltip with the name and/or portrait of the object. More...
 
bool showSpeechTooltip (const Common::UString &line)
 Create and show a tooltip with a line the object speaks. More...
 
void hideTooltip ()
 Hide the tooltip again. More...
 
- Protected Member Functions inherited from Engines::NWN::ScriptContainer
void clearScripts ()
 
void readScripts (const Aurora::GFF3Struct &gff)
 
void readScripts (const ScriptContainer &container)
 

Protected Attributes

Common::UString _modelName
 The model's resource name. More...
 
uint32 _appearanceID
 The index within the situated appearance 2DA. More...
 
uint32 _soundAppType
 The index within the situated sounds 2DA. More...
 
bool _locked
 Is the situated object locked? More...
 
Common::UString _soundOpened
 The sound the object makes when opened. More...
 
Common::UString _soundClosed
 The sound the object makes when closed. More...
 
Common::UString _soundDestroyed
 The sound the object makes when destroyed. More...
 
Common::UString _soundUsed
 The sound the object makes when used. More...
 
Common::UString _soundLocked
 The sound the object makes when locked. More...
 
Object_lastOpenedBy
 The object that last opened this situated object. More...
 
Object_lastClosedBy
 The object that last closed this situated object. More...
 
Object_lastUsedBy
 The object that last used this situated object. More...
 
Common::ScopedPtr< Graphics::Aurora::Model_model
 The situated object's model. More...
 
- Protected Attributes inherited from Engines::NWN::Object
ObjectType _type
 The object's type. More...
 
Common::UString _name
 The object's display name. More...
 
Common::UString _description
 The object's description. More...
 
Common::UString _portrait
 The object's portrait. More...
 
Common::UString _conversation
 The object's default conversation. More...
 
uint32 _soundSet
 The object's sound set, as an index into soundset.2da. More...
 
Common::ScopedPtr< Aurora::SSFFile_ssf
 The object's sound set. 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...
 
Aurora::NWScript::Object_pcSpeaker
 The current PC speaking with the object. 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...
 
Common::ScopedPtr< Tooltip_tooltip
 The tooltip displayed over the object. More...
 
- Protected Attributes inherited from Aurora::NWScript::Object
uint32 _id
 
Common::UString _tag
 

Private Member Functions

void loadProperties (const Aurora::GFF3Struct &gff)
 
void loadPortrait (const Aurora::GFF3Struct &gff)
 
void loadSounds ()
 
bool createTooltip (Tooltip::Type type)
 Create an empty tooltip. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Engines::NWN::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())
 

Detailed Description

Definition at line 40 of file situated.h.

Constructor & Destructor Documentation

◆ ~Situated()

Engines::NWN::Situated::~Situated ( )

Definition at line 50 of file situated.cpp.

◆ Situated()

Engines::NWN::Situated::Situated ( ObjectType  type)
protected

Definition at line 44 of file situated.cpp.

Member Function Documentation

◆ createTooltip()

bool Engines::NWN::Situated::createTooltip ( Tooltip::Type  type)
privatevirtual

Create an empty tooltip.

Reimplemented from Engines::NWN::Object.

Definition at line 236 of file situated.cpp.

References _model, Engines::NWN::Object::_portrait, and Engines::NWN::Object::_tooltip.

◆ getLastClosedBy()

Object * Engines::NWN::Situated::getLastClosedBy ( ) const

Return the object that last closed this situated object.

Definition at line 133 of file situated.cpp.

References _lastClosedBy.

Referenced by Engines::NWN::Functions::getLastClosedBy().

Here is the caller graph for this function:

◆ getLastOpenedBy()

Object * Engines::NWN::Situated::getLastOpenedBy ( ) const

Return the object that last opened this situated object.

Definition at line 129 of file situated.cpp.

References _lastOpenedBy.

Referenced by Engines::NWN::Functions::getLastOpenedBy().

Here is the caller graph for this function:

◆ getLastUsedBy()

Object * Engines::NWN::Situated::getLastUsedBy ( ) const

Return the object that last used this situated object.

Definition at line 137 of file situated.cpp.

References _lastUsedBy.

Referenced by Engines::NWN::Functions::getLastUsedBy().

Here is the caller graph for this function:

◆ hide()

void Engines::NWN::Situated::hide ( )
virtual

Hide the situated object's model.

Reimplemented from Engines::NWN::Object.

Definition at line 98 of file situated.cpp.

References _model, and Engines::NWN::Object::hideTooltip().

Referenced by Engines::NWN::Placeable::hide(), Engines::NWN::Door::hide(), and unloadModel().

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

◆ isLocked()

bool Engines::NWN::Situated::isLocked ( ) const

◆ isOpen()

virtual bool Engines::NWN::Situated::isOpen ( ) const
pure virtual

Is the situated object open?

Implemented in Engines::NWN::Door, and Engines::NWN::Placeable.

Referenced by Engines::NWN::Functions::getIsOpen().

Here is the caller graph for this function:

◆ load()

void Engines::NWN::Situated::load ( const Aurora::GFF3Struct instance,
const Aurora::GFF3Struct blueprint = 0 
)
protected

Load the situated object from an instance and its blueprint.

Definition at line 141 of file situated.cpp.

References _appearanceID, Aurora::GFF3Struct::getDouble(), Aurora::kFieldIDInvalid, loadAppearance(), loadObject(), loadProperties(), loadSounds(), Common::rad2deg(), setOrientation(), and setPosition().

Referenced by Engines::NWN::Placeable::load(), and Engines::NWN::Door::load().

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

◆ loadAppearance()

virtual void Engines::NWN::Situated::loadAppearance ( )
protectedpure virtual

Load appearance-specific properties.

Implemented in Engines::NWN::Placeable, and Engines::NWN::Door.

Referenced by load().

Here is the caller graph for this function:

◆ loadModel()

void Engines::NWN::Situated::loadModel ( )
virtual

◆ loadObject()

virtual void Engines::NWN::Situated::loadObject ( const Aurora::GFF3Struct gff)
protectedpure virtual

Load object-specific properties.

Implemented in Engines::NWN::Placeable, and Engines::NWN::Door.

Referenced by load().

Here is the caller graph for this function:

◆ loadPortrait()

void Engines::NWN::Situated::loadPortrait ( const Aurora::GFF3Struct gff)
private

Definition at line 210 of file situated.cpp.

References Engines::NWN::Object::_portrait, Common::UString::empty(), Aurora::TwoDAFile::getRow(), Aurora::TwoDARow::getString(), Aurora::GFF3Struct::getString(), Aurora::GFF3Struct::getUint(), and TwoDAReg.

Referenced by loadProperties().

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

◆ loadProperties()

void Engines::NWN::Situated::loadProperties ( const Aurora::GFF3Struct gff)
private

◆ loadSounds()

void Engines::NWN::Situated::loadSounds ( )
private

Definition at line 223 of file situated.cpp.

References _soundAppType, _soundClosed, _soundDestroyed, _soundLocked, _soundOpened, _soundUsed, Aurora::TwoDAFile::getRow(), Aurora::TwoDARow::getString(), Aurora::kFieldIDInvalid, and TwoDAReg.

Referenced by load().

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

◆ setLocked()

void Engines::NWN::Situated::setLocked ( bool  locked)
virtual

Lock/Unlock the situated object.

Reimplemented in Engines::NWN::Door.

Definition at line 125 of file situated.cpp.

References _locked.

Referenced by Engines::NWN::Door::setLocked(), and Engines::NWN::Functions::setLocked().

Here is the caller graph for this function:

◆ setOrientation()

void Engines::NWN::Situated::setOrientation ( float  x,
float  y,
float  z,
float  angle 
)
virtual

Set the situated object's orientation.

Reimplemented from Engines::NWN::Object.

Definition at line 113 of file situated.cpp.

References _model, Engines::NWN::Object::getOrientation(), and Engines::NWN::Object::setOrientation().

Referenced by load(), and loadModel().

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

◆ setPosition()

void Engines::NWN::Situated::setPosition ( float  x,
float  y,
float  z 
)
virtual

Set the situated object's position.

Reimplemented from Engines::NWN::Object.

Definition at line 105 of file situated.cpp.

References _model, Engines::NWN::Object::getPosition(), and Engines::NWN::Object::setPosition().

Referenced by load(), and loadModel().

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

◆ show()

void Engines::NWN::Situated::show ( )
virtual

Show the situated object's model.

Reimplemented from Engines::NWN::Object.

Definition at line 93 of file situated.cpp.

References _model.

Referenced by Engines::NWN::Placeable::show(), and Engines::NWN::Door::show().

Here is the caller graph for this function:

◆ unloadModel()

void Engines::NWN::Situated::unloadModel ( )
virtual

Unload the situated object's model.

Reimplemented from Engines::NWN::Object.

Definition at line 85 of file situated.cpp.

References _model, Engines::NWN::Object::destroyTooltip(), hide(), and Common::ScopedPtrBase< T, Deallocator >::reset().

Here is the call graph for this function:

Member Data Documentation

◆ _appearanceID

uint32 Engines::NWN::Situated::_appearanceID
protected

The index within the situated appearance 2DA.

Definition at line 77 of file situated.h.

Referenced by load(), Engines::NWN::Door::loadAppearance(), Engines::NWN::Placeable::loadAppearance(), and loadProperties().

◆ _lastClosedBy

Object* Engines::NWN::Situated::_lastClosedBy
protected

The object that last closed this situated object.

Definition at line 89 of file situated.h.

Referenced by Engines::NWN::Placeable::close(), Engines::NWN::Door::close(), and getLastClosedBy().

◆ _lastOpenedBy

Object* Engines::NWN::Situated::_lastOpenedBy
protected

The object that last opened this situated object.

Definition at line 88 of file situated.h.

Referenced by getLastOpenedBy(), Engines::NWN::Placeable::open(), and Engines::NWN::Door::open().

◆ _lastUsedBy

Object* Engines::NWN::Situated::_lastUsedBy
protected

The object that last used this situated object.

Definition at line 90 of file situated.h.

Referenced by Engines::NWN::Door::click(), Engines::NWN::Placeable::click(), and getLastUsedBy().

◆ _locked

bool Engines::NWN::Situated::_locked
protected

Is the situated object locked?

Definition at line 80 of file situated.h.

Referenced by isLocked(), loadProperties(), and setLocked().

◆ _model

Common::ScopedPtr<Graphics::Aurora::Model> Engines::NWN::Situated::_model
protected

◆ _modelName

Common::UString Engines::NWN::Situated::_modelName
protected

The model's resource name.

Definition at line 75 of file situated.h.

Referenced by Engines::NWN::Door::loadAppearance(), Engines::NWN::Placeable::loadAppearance(), and loadModel().

◆ _soundAppType

uint32 Engines::NWN::Situated::_soundAppType
protected

The index within the situated sounds 2DA.

Definition at line 78 of file situated.h.

Referenced by Engines::NWN::Placeable::loadAppearance(), Engines::NWN::Door::loadAppearance(), and loadSounds().

◆ _soundClosed

Common::UString Engines::NWN::Situated::_soundClosed
protected

The sound the object makes when closed.

Definition at line 83 of file situated.h.

Referenced by Engines::NWN::Placeable::getAnimationSound(), Engines::NWN::Door::getAnimationSound(), and loadSounds().

◆ _soundDestroyed

Common::UString Engines::NWN::Situated::_soundDestroyed
protected

The sound the object makes when destroyed.

Definition at line 84 of file situated.h.

Referenced by Engines::NWN::Door::getAnimationSound(), and loadSounds().

◆ _soundLocked

Common::UString Engines::NWN::Situated::_soundLocked
protected

◆ _soundOpened

Common::UString Engines::NWN::Situated::_soundOpened
protected

The sound the object makes when opened.

Definition at line 82 of file situated.h.

Referenced by Engines::NWN::Placeable::getAnimationSound(), Engines::NWN::Door::getAnimationSound(), and loadSounds().

◆ _soundUsed

Common::UString Engines::NWN::Situated::_soundUsed
protected

The sound the object makes when used.

Definition at line 85 of file situated.h.

Referenced by loadSounds().


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