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

An object within a Jade area. More...

#include <object.h>

Inheritance diagram for Engines::Jade::Object:
Inheritance graph
[legend]
Collaboration diagram for Engines::Jade::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 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::UStringgetConversation () const
 Return the object's default conversation (DLG). 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...
 
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 isActive () const
 Is the object currently active/available/visible? More...
 
bool isNoCollide () const
 Is collision checking disabled? More...
 
void setNoCollide (bool noCollide)
 Enable or disable collision checking. 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...
 
ObjectgetLastTriggerer () const
 Return the object that last triggered this object. More...
 
void speakString (int32 resref)
 Speak the specified string. More...
 
virtual void playAnimation (const Common::UString &animation="", bool restart=true, int32 loopCount=0)
 Play an object animation. More...
 
virtual void playAnimation (Animation animation)
 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::Jade::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

void loadPositional (const Aurora::GFF3Struct &gff)
 Load the object's positional gff struct which contains the position and orientation. More...
 
- Protected Member Functions inherited from Engines::Jade::ScriptContainer
void clearScripts ()
 
void readScripts (const Aurora::GFF3Struct &gff)
 
void readScripts (const ScriptContainer &container)
 

Protected Attributes

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 _conversation
 The object's default conversation. More...
 
bool _static
 Is the object static? More...
 
bool _usable
 Is the object usable? More...
 
bool _active
 Is the object currently active/available/visible? More...
 
bool _noCollide
 Is collision checking for the object disabled? 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...
 
Object_lastTriggerer
 The object that last used this object. More...
 
float _position [3]
 The object's position. More...
 
float _orientation [4]
 The object's orientation. More...
 
- Protected Attributes inherited from Aurora::NWScript::Object
uint32 _id
 
Common::UString _tag
 

Additional Inherited Members

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

An object within a Jade area.

Definition at line 53 of file object.h.

Constructor & Destructor Documentation

◆ Object()

Engines::Jade::Object::Object ( ObjectType  type = kObjectTypeInvalid)

Definition at line 40 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::Jade::Object::~Object ( )
virtual

Reimplemented from Aurora::NWScript::Object.

Definition at line 54 of file object.cpp.

References ObjectMan.

Member Function Documentation

◆ click()

bool Engines::Jade::Object::click ( Object triggerer = 0)
virtual

The object was clicked.

Definition at line 178 of file object.cpp.

References _lastTriggerer, Engines::Jade::ScriptContainer::hasScript(), Engines::Jade::kScriptOnClick, Engines::Jade::kScriptOnUse, and Engines::Jade::ScriptContainer::runScript().

Referenced by Engines::Jade::Area::click().

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

◆ enter()

void Engines::Jade::Object::enter ( )
virtual

The cursor entered the object.

Reimplemented in Engines::Jade::Creature, and Engines::Jade::Placeable.

Definition at line 169 of file object.cpp.

Referenced by Engines::Jade::Area::setActive().

Here is the caller graph for this function:

◆ getArea()

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

Return the area this object is currently in.

Definition at line 122 of file object.cpp.

References _area.

Referenced by Engines::Jade::Functions::getArea(), Engines::Jade::Functions::getNearestObject(), and Engines::Jade::Functions::jumpTo().

Here is the caller graph for this function:

◆ getConversation()

const Common::UString & Engines::Jade::Object::getConversation ( ) const

Return the object's default conversation (DLG).

Definition at line 82 of file object.cpp.

References _conversation.

Referenced by Engines::Jade::Functions::actionStartConversation().

Here is the caller graph for this function:

◆ getDescription()

const Common::UString & Engines::Jade::Object::getDescription ( ) const

Return the object's description.

Definition at line 78 of file object.cpp.

References _description.

◆ getIDs()

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

Return the object's model IDs.

Definition at line 110 of file object.cpp.

References _ids.

◆ getLastTriggerer()

Object * Engines::Jade::Object::getLastTriggerer ( ) const

Return the object that last triggered this object.

Definition at line 191 of file object.cpp.

References _lastTriggerer.

Referenced by Engines::Jade::Functions::getPriorActivation().

Here is the caller graph for this function:

◆ getLocation()

Location Engines::Jade::Object::getLocation ( ) const

Create a Location out of the object's area, position and orientation.

Definition at line 130 of file object.cpp.

References _area, _position, Engines::Jade::Location::setArea(), Engines::Jade::Location::setFacing(), and Engines::Jade::Location::setPosition().

Here is the call graph for this function:

◆ getName()

const Common::UString & Engines::Jade::Object::getName ( ) const

Return the object's name.

Definition at line 74 of file object.cpp.

References _name.

Referenced by Engines::Jade::Functions::actionStartConversation(), Engines::Jade::Functions::sendMessageToPC(), and speakString().

Here is the caller graph for this function:

◆ getOrientation()

void Engines::Jade::Object::getOrientation ( float &  x,
float &  y,
float &  z,
float &  angle 
) const
virtual

Return the object's orientation.

Definition at line 148 of file object.cpp.

References _orientation.

Referenced by Engines::Jade::Placeable::loadAppearance(), and Engines::Jade::Creature::setOrientation().

Here is the caller graph for this function:

◆ getPCSpeaker()

Aurora::NWScript::Object * Engines::Jade::Object::getPCSpeaker ( ) const

Return the PC currently speaking with this object.

Definition at line 114 of file object.cpp.

References _pcSpeaker.

Referenced by Engines::Jade::Functions::actionStartConversation().

Here is the caller graph for this function:

◆ getPosition()

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

◆ getType()

ObjectType Engines::Jade::Object::getType ( ) const

Return the exact type of the object.

Definition at line 58 of file object.cpp.

References _type.

Referenced by Engines::Jade::Functions::getNearestObject(), Engines::Jade::Functions::getObjectType(), and Engines::Jade::Functions::getParamObject().

Here is the caller graph for this function:

◆ hide()

void Engines::Jade::Object::hide ( )
virtual

Hide the object's model(s).

Reimplemented in Engines::Jade::Area, Engines::Jade::Creature, and Engines::Jade::Placeable.

Definition at line 71 of file object.cpp.

Referenced by Engines::Jade::Waypoint::~Waypoint().

Here is the caller graph for this function:

◆ highlight()

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

(Un)Highlight the object.

Reimplemented in Engines::Jade::Creature, and Engines::Jade::Placeable.

Definition at line 175 of file object.cpp.

◆ isActive()

bool Engines::Jade::Object::isActive ( ) const

Is the object currently active/available/visible?

Definition at line 94 of file object.cpp.

References _active.

◆ isClickable()

bool Engines::Jade::Object::isClickable ( ) const

Can the player click the object?

Definition at line 106 of file object.cpp.

References _static, and _usable.

Referenced by Engines::Jade::Placeable::loadAppearance(), and Engines::Jade::Creature::loadBody().

Here is the caller graph for this function:

◆ isNoCollide()

bool Engines::Jade::Object::isNoCollide ( ) const

Is collision checking disabled?

Definition at line 98 of file object.cpp.

References _noCollide.

◆ isStatic()

bool Engines::Jade::Object::isStatic ( ) const

Is the object static (not manipulable at all)?

Definition at line 86 of file object.cpp.

References _static.

Referenced by Engines::Jade::Area::loadObject().

Here is the caller graph for this function:

◆ isUsable()

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

Can the object be used by the PC?

Definition at line 90 of file object.cpp.

References _usable.

◆ leave()

void Engines::Jade::Object::leave ( )
virtual

The cursor left the object.

Reimplemented in Engines::Jade::Creature, and Engines::Jade::Placeable.

Definition at line 172 of file object.cpp.

Referenced by Engines::Jade::Area::removeFocus(), and Engines::Jade::Area::setActive().

Here is the caller graph for this function:

◆ loadModel()

void Engines::Jade::Object::loadModel ( )
virtual

Load the object's model(s).

Definition at line 62 of file object.cpp.

◆ loadPositional()

void Engines::Jade::Object::loadPositional ( const Aurora::GFF3Struct gff)
protected

Load the object's positional gff struct which contains the position and orientation.

Definition at line 212 of file object.cpp.

References Aurora::GFF3Struct::getStruct(), Aurora::GFF3Struct::getVector(), setOrientation(), and setPosition().

Referenced by Engines::Jade::Waypoint::load(), Engines::Jade::Placeable::loadInstance(), Engines::Jade::Trigger::loadInstance(), and Engines::Jade::Creature::loadInstance().

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

◆ playAnimation() [1/2]

void Engines::Jade::Object::playAnimation ( const Common::UString animation = "",
bool  restart = true,
int32  loopCount = 0 
)
virtual

Play an object animation.

Definition at line 201 of file object.cpp.

References Common::UString::c_str(), and warning().

Referenced by Engines::Jade::Placeable::open().

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

◆ playAnimation() [2/2]

void Engines::Jade::Object::playAnimation ( Animation  animation)
virtual

Play a default object animation.

Definition at line 207 of file object.cpp.

References warning().

Here is the call graph for this function:

◆ setArea()

void Engines::Jade::Object::setArea ( Area area)

Set the area this object is currently in.

Definition at line 126 of file object.cpp.

References _area.

◆ setNoCollide()

void Engines::Jade::Object::setNoCollide ( bool  noCollide)

Enable or disable collision checking.

Definition at line 102 of file object.cpp.

References _noCollide.

◆ setOrientation()

void Engines::Jade::Object::setOrientation ( float  x,
float  y,
float  z,
float  angle 
)
virtual

Set the object's orientation.

Reimplemented in Engines::Jade::Creature.

Definition at line 162 of file object.cpp.

References _orientation.

Referenced by loadPositional(), and Engines::Jade::Creature::setOrientation().

Here is the caller graph for this function:

◆ setPCSpeaker()

void Engines::Jade::Object::setPCSpeaker ( Aurora::NWScript::Object pc)

Set the PC currently speaking with this object.

Definition at line 118 of file object.cpp.

References _pcSpeaker.

◆ setPosition()

void Engines::Jade::Object::setPosition ( float  x,
float  y,
float  z 
)
virtual

Set the object's position within its area.

Reimplemented in Engines::Jade::Creature.

Definition at line 156 of file object.cpp.

References _position.

Referenced by loadPositional(), and Engines::Jade::Creature::setPosition().

Here is the caller graph for this function:

◆ show()

void Engines::Jade::Object::show ( )
virtual

Show the object's model(s).

Reimplemented in Engines::Jade::Area, Engines::Jade::Creature, and Engines::Jade::Placeable.

Definition at line 68 of file object.cpp.

◆ speakString()

void Engines::Jade::Object::speakString ( int32  resref)

Speak the specified string.

Definition at line 195 of file object.cpp.

References getName(), status(), and TalkMan.

Referenced by Engines::Jade::Functions::actionSpeakStringByStrRef().

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

◆ unloadModel()

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

Unload the object's model(s).

Definition at line 65 of file object.cpp.

Member Data Documentation

◆ _active

bool Engines::Jade::Object::_active
protected

Is the object currently active/available/visible?

Definition at line 156 of file object.h.

Referenced by isActive(), Engines::Jade::Placeable::loadInstance(), and Engines::Jade::Creature::loadInstance().

◆ _area

Area* Engines::Jade::Object::_area
protected

The area the object is currently in.

Definition at line 164 of file object.h.

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

◆ _conversation

Common::UString Engines::Jade::Object::_conversation
protected

The object's default conversation.

Definition at line 152 of file object.h.

Referenced by getConversation(), Engines::Jade::Placeable::loadBlueprint(), and Engines::Jade::Creature::loadBlueprint().

◆ _description

Common::UString Engines::Jade::Object::_description
protected

The object's description.

Definition at line 150 of file object.h.

Referenced by getDescription().

◆ _ids

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

The object's model IDs.

Definition at line 160 of file object.h.

Referenced by getIDs(), Engines::Jade::Placeable::loadAppearance(), and Engines::Jade::Creature::loadBody().

◆ _lastTriggerer

Object* Engines::Jade::Object::_lastTriggerer
protected

The object that last used this object.

Definition at line 166 of file object.h.

Referenced by click(), and getLastTriggerer().

◆ _name

Common::UString Engines::Jade::Object::_name
protected

◆ _noCollide

bool Engines::Jade::Object::_noCollide
protected

Is collision checking for the object disabled?

Definition at line 158 of file object.h.

Referenced by isNoCollide(), and setNoCollide().

◆ _orientation

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

The object's orientation.

Definition at line 169 of file object.h.

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

◆ _pcSpeaker

Aurora::NWScript::Object* Engines::Jade::Object::_pcSpeaker
protected

The current PC speaking with the object.

Definition at line 162 of file object.h.

Referenced by getPCSpeaker(), and setPCSpeaker().

◆ _position

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

The object's position.

Definition at line 168 of file object.h.

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

◆ _static

bool Engines::Jade::Object::_static
protected

Is the object static?

Definition at line 154 of file object.h.

Referenced by isClickable(), and isStatic().

◆ _type

ObjectType Engines::Jade::Object::_type
protected

The object's type.

Definition at line 147 of file object.h.

Referenced by getType().

◆ _usable

bool Engines::Jade::Object::_usable
protected

Is the object usable?

Definition at line 155 of file object.h.

Referenced by isClickable(), and isUsable().


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