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

#include <placeable.h>

Inheritance diagram for Engines::Jade::Placeable:
Inheritance graph
[legend]
Collaboration diagram for Engines::Jade::Placeable:
Collaboration graph
[legend]

Public Member Functions

 Placeable (const Aurora::GFF3Struct &placeable)
 Load from a placeable instance. More...
 
 ~Placeable ()
 
void show ()
 Show the placeable's model. More...
 
void hide ()
 Hide the placeable's model. More...
 
bool open (Object *opener)
 The opener object opens this placeable. More...
 
bool close (Object *closer)
 The closer object closes this placeable. More...
 
void enter ()
 The cursor entered the placeable. More...
 
void leave ()
 The cursor left the placeable. More...
 
virtual void highlight (bool enabled)
 (Un)Highlight the placeable. More...
 
- Public Member Functions inherited from Engines::Jade::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...
 
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 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 Attributes

Common::UString _modelName
 The model's resource name. More...
 
Common::UString _soundCue
 The placeable's sound cue. More...
 
Common::UString _resRef
 The placeable's description resref. More...
 
uint32 _appearanceType
 The index within the placeable 2DA. More...
 
Object_lastOpenedBy
 The object that last opened this placeable object. More...
 
Object_lastClosedBy
 The object that last closed this placeable object. More...
 
Common::ScopedPtr< Graphics::Aurora::Model_model
 The placeable's model. More...
 
int32 _state
 The placeable's current state. More...
 
Common::ScopedPtr< Aurora::GFF3File_fsm
 The placeable's state file. More...
 
- Protected Attributes inherited from Engines::Jade::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 _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
 

Private Member Functions

void load (const Aurora::GFF3Struct &placeable)
 Load from a placeable instance. More...
 
void loadBlueprint (const Aurora::GFF3Struct &gff)
 Load the placeable's blueprint properties. More...
 
void loadInstance (const Aurora::GFF3Struct &gff)
 Load the placeable's instance properties. More...
 
void loadProperties ()
 Load properties from placeable.2da. More...
 
void loadAppearance ()
 Load appearance-specific properties. More...
 
int32 nextState (const Common::UString &input)
 Determines the result State according to the state model. More...
 

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())
 
- Protected Member Functions inherited from Engines::Jade::Object
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)
 

Detailed Description

Definition at line 40 of file placeable.h.

Constructor & Destructor Documentation

◆ Placeable()

Engines::Jade::Placeable::Placeable ( const Aurora::GFF3Struct placeable)

Load from a placeable instance.

Definition at line 44 of file placeable.cpp.

References load().

Here is the call graph for this function:

◆ ~Placeable()

Engines::Jade::Placeable::~Placeable ( )

Definition at line 50 of file placeable.cpp.

Member Function Documentation

◆ close()

bool Engines::Jade::Placeable::close ( Object closer)

The closer object closes this placeable.

Definition at line 200 of file placeable.cpp.

References _lastClosedBy, _state, Engines::Jade::kScriptOnClose, nextState(), and Engines::Jade::ScriptContainer::runScript().

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

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

◆ enter()

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

The cursor entered the placeable.

Reimplemented from Engines::Jade::Object.

Definition at line 170 of file placeable.cpp.

References highlight().

Here is the call graph for this function:

◆ hide()

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

Hide the placeable's model.

Reimplemented from Engines::Jade::Object.

Definition at line 58 of file placeable.cpp.

References _model, and leave().

Here is the call graph for this function:

◆ highlight()

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

(Un)Highlight the placeable.

Reimplemented from Engines::Jade::Object.

Definition at line 178 of file placeable.cpp.

References _model.

Referenced by enter(), and leave().

Here is the caller graph for this function:

◆ leave()

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

The cursor left the placeable.

Reimplemented from Engines::Jade::Object.

Definition at line 174 of file placeable.cpp.

References highlight().

Referenced by hide().

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

◆ load()

void Engines::Jade::Placeable::load ( const Aurora::GFF3Struct placeable)
private

Load from a placeable instance.

Definition at line 64 of file placeable.cpp.

References _resRef, Aurora::NWScript::Object::_tag, Common::StackException::add(), Common::UString::c_str(), Common::UString::empty(), Aurora::GFF3Struct::getString(), Aurora::kFileTypePLA, loadAppearance(), loadBlueprint(), loadInstance(), loadProperties(), and MKTAG.

Referenced by Placeable().

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

◆ loadAppearance()

void Engines::Jade::Placeable::loadAppearance ( )
private

◆ loadBlueprint()

void Engines::Jade::Placeable::loadBlueprint ( const Aurora::GFF3Struct gff)
private

Load the placeable's blueprint properties.

Definition at line 85 of file placeable.cpp.

References _appearanceType, Engines::Jade::Object::_conversation, _soundCue, Aurora::GFF3Struct::getString(), Aurora::GFF3Struct::getUint(), and Engines::Jade::ScriptContainer::readScripts().

Referenced by load().

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

◆ loadInstance()

void Engines::Jade::Placeable::loadInstance ( const Aurora::GFF3Struct gff)
private

◆ loadProperties()

void Engines::Jade::Placeable::loadProperties ( )
private

Load properties from placeable.2da.

Definition at line 99 of file placeable.cpp.

References _appearanceType, _modelName, Engines::Jade::Object::_name, Aurora::NWScript::Object::_tag, Common::UString::c_str(), Aurora::TwoDARow::getInt(), Aurora::TwoDARow::getString(), Aurora::kFieldIDInvalid, TalkMan, TwoDAReg, and warning().

Referenced by load().

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

◆ nextState()

int32 Engines::Jade::Placeable::nextState ( const Common::UString input)
private

Determines the result State according to the state model.

Definition at line 215 of file placeable.cpp.

References _fsm, _state, Common::UString::format(), Aurora::GFF3Struct::getSint(), Aurora::GFF3Struct::getString(), and Aurora::GFF3Struct::getStruct().

Referenced by close(), and open().

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

◆ open()

bool Engines::Jade::Placeable::open ( Object opener)

The opener object opens this placeable.

Definition at line 183 of file placeable.cpp.

References _lastOpenedBy, _state, Engines::Jade::kAnimationOpeningADoorDoubleDoor, Engines::Jade::kScriptOnFailToOpen, Engines::Jade::kScriptOnOpen, nextState(), Engines::Jade::Object::playAnimation(), and Engines::Jade::ScriptContainer::runScript().

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

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

◆ show()

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

Show the placeable's model.

Reimplemented from Engines::Jade::Object.

Definition at line 53 of file placeable.cpp.

References _model.

Member Data Documentation

◆ _appearanceType

uint32 Engines::Jade::Placeable::_appearanceType
protected

The index within the placeable 2DA.

Definition at line 71 of file placeable.h.

Referenced by loadBlueprint(), and loadProperties().

◆ _fsm

Common::ScopedPtr<Aurora::GFF3File> Engines::Jade::Placeable::_fsm
protected

The placeable's state file.

Definition at line 79 of file placeable.h.

Referenced by loadInstance(), and nextState().

◆ _lastClosedBy

Object* Engines::Jade::Placeable::_lastClosedBy
protected

The object that last closed this placeable object.

Definition at line 74 of file placeable.h.

Referenced by close().

◆ _lastOpenedBy

Object* Engines::Jade::Placeable::_lastOpenedBy
protected

The object that last opened this placeable object.

Definition at line 73 of file placeable.h.

Referenced by open().

◆ _model

Common::ScopedPtr<Graphics::Aurora::Model> Engines::Jade::Placeable::_model
protected

The placeable's model.

Definition at line 76 of file placeable.h.

Referenced by hide(), highlight(), loadAppearance(), and show().

◆ _modelName

Common::UString Engines::Jade::Placeable::_modelName
protected

The model's resource name.

Definition at line 67 of file placeable.h.

Referenced by loadAppearance(), loadInstance(), and loadProperties().

◆ _resRef

Common::UString Engines::Jade::Placeable::_resRef
protected

The placeable's description resref.

Definition at line 69 of file placeable.h.

Referenced by load().

◆ _soundCue

Common::UString Engines::Jade::Placeable::_soundCue
protected

The placeable's sound cue.

Definition at line 68 of file placeable.h.

Referenced by loadBlueprint(), and loadInstance().

◆ _state

int32 Engines::Jade::Placeable::_state
protected

The placeable's current state.

Definition at line 78 of file placeable.h.

Referenced by close(), loadInstance(), nextState(), and open().


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