xoreos  0.0.5
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Engines::NWN::Waypoint Class Reference

#include <waypoint.h>

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

Public Member Functions

 Waypoint (const Aurora::GFF3Struct &waypoint)
 Load from a waypoint instance. More...
 
 ~Waypoint ()
 
bool hasMapNote () const
 Does this waypoint have a map note? More...
 
bool enabledMapNote () const
 Is this waypoint's map note currently enabled? More...
 
void enableMapNote (bool enabled)
 Enable/Disable the waypoint's map note. More...
 
Common::UString getMapNote () const
 Return the waypoint's map note text. 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...
 
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::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...
 
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...
 
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())
 

Private Member Functions

void load (const Aurora::GFF3Struct &waypoint)
 Load from a waypoint instance. More...
 
void load (const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint)
 Load the waypoint from an instance and its blueprint. More...
 
void loadProperties (const Aurora::GFF3Struct &gff)
 Load general waypoint properties. More...
 

Private Attributes

bool _hasMapNote
 Does this waypoint have a map note? More...
 
bool _enabledMapNote
 Is this waypoint's map note enabled? More...
 
Common::UString _mapNote
 The waypoint's map note text. 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())
 
- 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...
 
virtual bool createTooltip (Tooltip::Type type)
 Create an empty tooltip. 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 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
 

Detailed Description

Definition at line 40 of file waypoint.h.

Constructor & Destructor Documentation

◆ Waypoint()

Engines::NWN::Waypoint::Waypoint ( const Aurora::GFF3Struct waypoint)

Load from a waypoint instance.

Definition at line 39 of file waypoint.cpp.

References load().

Here is the call graph for this function:

◆ ~Waypoint()

Engines::NWN::Waypoint::~Waypoint ( )

Definition at line 45 of file waypoint.cpp.

References Engines::NWN::Object::hide().

Here is the call graph for this function:

Member Function Documentation

◆ enabledMapNote()

bool Engines::NWN::Waypoint::enabledMapNote ( ) const

Is this waypoint's map note currently enabled?

Definition at line 63 of file waypoint.cpp.

References _enabledMapNote, and _hasMapNote.

◆ enableMapNote()

void Engines::NWN::Waypoint::enableMapNote ( bool  enabled)

Enable/Disable the waypoint's map note.

Definition at line 67 of file waypoint.cpp.

References _enabledMapNote.

◆ getMapNote()

Common::UString Engines::NWN::Waypoint::getMapNote ( ) const

Return the waypoint's map note text.

Definition at line 71 of file waypoint.cpp.

References _mapNote.

◆ hasMapNote()

bool Engines::NWN::Waypoint::hasMapNote ( ) const

Does this waypoint have a map note?

Definition at line 59 of file waypoint.cpp.

References _hasMapNote.

◆ load() [1/2]

void Engines::NWN::Waypoint::load ( const Aurora::GFF3Struct waypoint)
private

Load from a waypoint instance.

Definition at line 49 of file waypoint.cpp.

References Common::UString::empty(), Aurora::GFF3Struct::getString(), Aurora::kFileTypeUTW, Engines::loadOptionalGFF3(), MKTAG, and Common::ScopedPtrBase< T, Deallocator >::reset().

Referenced by Waypoint().

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

◆ load() [2/2]

void Engines::NWN::Waypoint::load ( const Aurora::GFF3Struct instance,
const Aurora::GFF3Struct blueprint 
)
private

Load the waypoint from an instance and its blueprint.

Definition at line 75 of file waypoint.cpp.

References Aurora::GFF3Struct::getDouble(), loadProperties(), Common::rad2deg(), Engines::NWN::Object::setOrientation(), and Engines::NWN::Object::setPosition().

Here is the call graph for this function:

◆ loadProperties()

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

Load general waypoint properties.

Definition at line 96 of file waypoint.cpp.

References _enabledMapNote, _hasMapNote, _mapNote, Aurora::NWScript::Object::_tag, Aurora::GFF3Struct::getBool(), Aurora::GFF3Struct::getString(), and Engines::NWN::ScriptContainer::readScripts().

Referenced by load().

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

Member Data Documentation

◆ _enabledMapNote

bool Engines::NWN::Waypoint::_enabledMapNote
private

Is this waypoint's map note enabled?

Definition at line 61 of file waypoint.h.

Referenced by enabledMapNote(), enableMapNote(), and loadProperties().

◆ _hasMapNote

bool Engines::NWN::Waypoint::_hasMapNote
private

Does this waypoint have a map note?

Definition at line 60 of file waypoint.h.

Referenced by enabledMapNote(), hasMapNote(), and loadProperties().

◆ _mapNote

Common::UString Engines::NWN::Waypoint::_mapNote
private

The waypoint's map note text.

Definition at line 64 of file waypoint.h.

Referenced by getMapNote(), and loadProperties().


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