xoreos
0.0.5
|
#include <object.h>
Public Member Functions | |
Object (ObjectType type=kObjectTypeInvalid) | |
virtual | ~Object () |
ObjectType | getType () const |
Return the exact type of the object. More... | |
virtual void | show () |
Show the object's model(s). More... | |
virtual void | hide () |
Hide the object's model(s). More... | |
virtual void | hideSoft () |
Hide the object's model(s) if applicable. More... | |
virtual bool | isVisible () const |
Is the object's model(s) visible? More... | |
const std::list< uint32 > & | getIDs () const |
Return the object's model IDs. More... | |
const Common::UString & | getName () const |
Return the object's name. More... | |
const Common::UString & | getDescription () const |
Return the object's description. More... | |
const Common::UString & | getPortrait () const |
Return the object's portrait. More... | |
void | setMaxHitPoints (int maxHP) |
Set the maximum hit points for the objects. More... | |
int | getMaxHitPoints () |
Get the maximum hit points for the objects. More... | |
void | setCurrentHitPoints (int hitpoints) |
Set the current hitpoints. More... | |
int | getCurrentHitPoints () |
Return the objects current hitpoints. More... | |
void | setMinOneHitPoints (bool enabled) |
Set if the object has a minimum of one hp. More... | |
bool | getMinOneHitPoints () const |
Get if the object has a minimum of one hp. 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... | |
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... | |
void | makeLookAt (float x, float y) |
void | makeLookAt (Object *target) |
Room * | getRoom () |
Get a room the object is in. More... | |
void | setRoom (Room *room) |
Set a room the object is in. 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 | 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 &anim, bool restart=true, float length=0.0f, float speed=1.0f) |
Public Member Functions inherited from Aurora::NWScript::Object | |
Object () | |
uint32 | getID () const |
const Common::UString & | getTag () const |
Public Member Functions inherited from Aurora::NWScript::VariableContainer | |
VariableContainer () | |
virtual | ~VariableContainer () |
bool | hasVariable (const Common::UString &var) const |
Variable & | getVariable (const Common::UString &var, Type type=kTypeVoid) |
const Variable & | getVariable (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::KotOR::ScriptContainer | |
ScriptContainer () | |
~ScriptContainer () | |
const Common::UString & | getScript (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 | _name |
The object's display name. More... | |
Common::UString | _description |
The object's description. More... | |
Common::UString | _portrait |
The object's portrait. More... | |
bool | _static |
Is the object static? More... | |
bool | _usable |
Is the object usable? More... | |
int | _currentHitPoints |
The current hitpoints of the object. More... | |
int | _maxHitPoints |
The maximum hitpoints of the object. More... | |
bool | _minOneHitPoint |
If the object should have at least one hitpoint. More... | |
std::list< uint32 > | _ids |
The object's model IDs. 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... | |
Room * | _room |
Room the object is in. More... | |
Protected Attributes inherited from Aurora::NWScript::Object | |
uint32 | _id |
Common::UString | _tag |
Additional Inherited Members | |
Static Public Member Functions inherited from Engines::KotOR::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::KotOR::ScriptContainer | |
void | clearScripts () |
void | readScripts (const Aurora::GFF3Struct &gff, bool clear=true) |
void | readScripts (const ScriptContainer &container) |
Engines::KotOR::Object::Object | ( | ObjectType | type = kObjectTypeInvalid | ) |
Definition at line 41 of file object.cpp.
References Aurora::NWScript::Object::_id, _orientation, _position, Common::generateIDNumber(), and ObjectMan.
|
virtual |
Reimplemented from Aurora::NWScript::Object.
Definition at line 61 of file object.cpp.
References ObjectMan.
|
virtual |
The object was clicked.
Reimplemented in Engines::KotOR::Creature, Engines::KotOR::Placeable, and Engines::KotOR::Door.
Definition at line 192 of file object.cpp.
Referenced by Engines::KotOR::Area::click().
|
virtual |
The cursor entered the object.
Reimplemented in Engines::KotOR::Module, Engines::KotOR::Creature, Engines::KotOR::Placeable, and Engines::KotOR::Door.
Definition at line 183 of file object.cpp.
Referenced by Engines::KotOR::Area::setActive().
int Engines::KotOR::Object::getCurrentHitPoints | ( | ) |
Return the objects current hitpoints.
Definition at line 110 of file object.cpp.
References _currentHitPoints.
Referenced by Engines::KotOR::Functions::getCurrentHitPoints().
const Common::UString & Engines::KotOR::Object::getDescription | ( | ) | const |
const std::list< uint32 > & Engines::KotOR::Object::getIDs | ( | ) | const |
Return the object's model IDs.
Definition at line 134 of file object.cpp.
References _ids.
Referenced by Engines::KotOR::Area::removeObject().
int Engines::KotOR::Object::getMaxHitPoints | ( | ) |
Get the maximum hit points for the objects.
Definition at line 99 of file object.cpp.
References _maxHitPoints.
Referenced by Engines::KotOR::Functions::getMaxHitPoints().
bool Engines::KotOR::Object::getMinOneHitPoints | ( | ) | const |
Get if the object has a minimum of one hp.
Definition at line 118 of file object.cpp.
References _minOneHitPoint.
Referenced by Engines::KotOR::Functions::getMinOneHP().
const Common::UString & Engines::KotOR::Object::getName | ( | ) | const |
Return the object's name.
Definition at line 83 of file object.cpp.
References _name.
Referenced by Engines::KotOR::Module::getName(), and Engines::KotOR::Functions::sendMessageToPC().
|
virtual |
Return the object's orientation.
Definition at line 144 of file object.cpp.
References _orientation.
Referenced by Engines::KotOR::Creature::changeBody(), Engines::KotOR::DialogGUI::makeLookAtPC(), Engines::KotOR::Situated::setOrientation(), and Engines::KotOR::Creature::setOrientation().
const Common::UString & Engines::KotOR::Object::getPortrait | ( | ) | const |
Return the object's portrait.
Definition at line 91 of file object.cpp.
References _portrait.
Referenced by Engines::KotOR::HUD::setPartyLeader(), Engines::KotOR::HUD::setPartyMember1(), and Engines::KotOR::HUD::setPartyMember2().
|
virtual |
Return the object's position within its area.
Definition at line 138 of file object.cpp.
References _position.
Referenced by Engines::KotOR::Creature::changeBody(), Engines::KotOR::ActionExecutor::executeFollowLeader(), Engines::KotOR::ObjectDistanceSort::getDistance(), Engines::KotOR::Module::getObjectLocation(), Engines::KotOR::ActionExecutor::moveTo(), Engines::KotOR::Area::notifyObjectMoved(), Engines::KotOR::ObjectDistanceSort::ObjectDistanceSort(), Engines::KotOR::Situated::setPosition(), and Engines::KotOR::Creature::setPosition().
Room * Engines::KotOR::Object::getRoom | ( | ) |
Get a room the object is in.
Definition at line 175 of file object.cpp.
References _room.
Referenced by Engines::KotOR::Console::cmdGetPCRoom(), and Engines::KotOR::Area::notifyPCMoved().
ObjectType Engines::KotOR::Object::getType | ( | ) | const |
Return the exact type of the object.
Definition at line 65 of file object.cpp.
References _type.
Referenced by Engines::KotOR::Module::getObjectLocation(), and Engines::KotOR::Functions::getParamObject().
|
virtual |
Hide the object's model(s).
Reimplemented in Engines::KotOR::Area, Engines::KotOR::Creature, Engines::KotOR::Placeable, Engines::KotOR::Door, Engines::KotOR::Situated, and Engines::KotOR::Trigger.
Definition at line 72 of file object.cpp.
Referenced by hideSoft(), and Engines::KotOR::Waypoint::~Waypoint().
|
virtual |
Hide the object's model(s) if applicable.
Reimplemented in Engines::KotOR::Door, and Engines::KotOR::Trigger.
Definition at line 75 of file object.cpp.
References hide().
|
virtual |
(Un)Highlight the object.
Reimplemented in Engines::KotOR::Creature, Engines::KotOR::Placeable, and Engines::KotOR::Door.
Definition at line 189 of file object.cpp.
bool Engines::KotOR::Object::isClickable | ( | ) | const |
Can the player click the object?
Definition at line 130 of file object.cpp.
References _static, and _usable.
Referenced by Engines::KotOR::Situated::load(), and Engines::KotOR::Creature::loadBody().
bool Engines::KotOR::Object::isStatic | ( | ) | const |
Is the object static (not manipulable at all)?
Definition at line 122 of file object.cpp.
References _static.
Referenced by Engines::KotOR::Area::loadObject(), and Engines::KotOR::Area::removeObject().
bool Engines::KotOR::Object::isUsable | ( | ) | const |
|
virtual |
Is the object's model(s) visible?
Reimplemented in Engines::KotOR::Creature, Engines::KotOR::Situated, and Engines::KotOR::Trigger.
Definition at line 79 of file object.cpp.
|
virtual |
The cursor left the object.
Reimplemented in Engines::KotOR::Module, Engines::KotOR::Creature, Engines::KotOR::Placeable, and Engines::KotOR::Door.
Definition at line 186 of file object.cpp.
Referenced by Engines::KotOR::Area::removeFocus(), and Engines::KotOR::Area::setActive().
void Engines::KotOR::Object::makeLookAt | ( | float | x, |
float | y | ||
) |
Definition at line 165 of file object.cpp.
References _position, Common::rad2deg(), and setOrientation().
Referenced by makeLookAt(), Engines::KotOR::DialogGUI::makeLookAtPC(), and Engines::KotOR::ActionExecutor::moveTo().
void Engines::KotOR::Object::makeLookAt | ( | Object * | target | ) |
Definition at line 171 of file object.cpp.
References _position, and makeLookAt().
|
virtual |
Reimplemented in Engines::KotOR::Creature, and Engines::KotOR::Situated.
Definition at line 208 of file object.cpp.
Referenced by Engines::KotOR::Module::playAnimationOnActiveObject().
void Engines::KotOR::Object::playSound | ( | const Common::UString & | sound, |
bool | pitchVariance = false |
||
) |
Play an object sound.
Definition at line 200 of file object.cpp.
References _sound, Common::UString::empty(), Sound::kSoundTypeVoice, Engines::playSound(), and stopSound().
Referenced by Engines::KotOR::Placeable::activate(), Engines::KotOR::Placeable::click(), Engines::KotOR::Door::close(), Engines::KotOR::Placeable::close(), Engines::KotOR::Placeable::deactivate(), Engines::KotOR::Door::open(), and Engines::KotOR::Placeable::open().
void Engines::KotOR::Object::setCurrentHitPoints | ( | int | hitpoints | ) |
Set the current hitpoints.
Definition at line 103 of file object.cpp.
References _currentHitPoints, _maxHitPoints, _minOneHitPoint, and MIN().
Referenced by Engines::KotOR::Functions::setMaxHitPoints().
void Engines::KotOR::Object::setMaxHitPoints | ( | int | maxHP | ) |
Set the maximum hit points for the objects.
Definition at line 95 of file object.cpp.
References _maxHitPoints.
Referenced by Engines::KotOR::Functions::setMaxHitPoints().
void Engines::KotOR::Object::setMinOneHitPoints | ( | bool | enabled | ) |
Set if the object has a minimum of one hp.
Definition at line 114 of file object.cpp.
References _minOneHitPoint.
Referenced by Engines::KotOR::Functions::setMinOneHP().
|
virtual |
Set the object's orientation.
Reimplemented in Engines::KotOR::Creature, and Engines::KotOR::Situated.
Definition at line 158 of file object.cpp.
References _orientation.
Referenced by Engines::KotOR::Waypoint::load(), makeLookAt(), Engines::KotOR::Situated::setOrientation(), and Engines::KotOR::Creature::setOrientation().
|
virtual |
Set the object's position within its area.
Reimplemented in Engines::KotOR::Creature, Engines::KotOR::Situated, and Engines::KotOR::SoundObject.
Definition at line 152 of file object.cpp.
References _position.
Referenced by Engines::KotOR::Trigger::load(), Engines::KotOR::Waypoint::load(), Engines::KotOR::SoundObject::setPosition(), Engines::KotOR::Situated::setPosition(), and Engines::KotOR::Creature::setPosition().
void Engines::KotOR::Object::setRoom | ( | Room * | room | ) |
Set a room the object is in.
Definition at line 179 of file object.cpp.
References _room.
Referenced by Engines::KotOR::Area::notifyObjectMoved().
|
virtual |
Show the object's model(s).
Reimplemented in Engines::KotOR::Area, Engines::KotOR::Creature, Engines::KotOR::Situated, and Engines::KotOR::Trigger.
Definition at line 69 of file object.cpp.
void Engines::KotOR::Object::stopSound | ( | ) |
Stop the current object sound.
Definition at line 196 of file object.cpp.
References _sound, and SoundMan.
Referenced by playSound().
|
protected |
The current hitpoints of the object.
Definition at line 150 of file object.h.
Referenced by getCurrentHitPoints(), Engines::KotOR::Placeable::loadObject(), Engines::KotOR::Creature::loadProperties(), and setCurrentHitPoints().
|
protected |
The object's description.
Definition at line 143 of file object.h.
Referenced by getDescription(), Engines::KotOR::Item::load(), Engines::KotOR::Situated::loadProperties(), and Engines::KotOR::Creature::loadProperties().
|
protected |
The object's model IDs.
Definition at line 154 of file object.h.
Referenced by getIDs(), Engines::KotOR::Situated::load(), and Engines::KotOR::Creature::loadBody().
|
protected |
The maximum hitpoints of the object.
Definition at line 151 of file object.h.
Referenced by getMaxHitPoints(), Engines::KotOR::Placeable::loadObject(), Engines::KotOR::Creature::loadProperties(), setCurrentHitPoints(), and setMaxHitPoints().
|
protected |
If the object should have at least one hitpoint.
Definition at line 152 of file object.h.
Referenced by getMinOneHitPoints(), Engines::KotOR::Placeable::loadObject(), Engines::KotOR::Creature::loadProperties(), setCurrentHitPoints(), and setMinOneHitPoints().
|
protected |
The object's display name.
Definition at line 142 of file object.h.
Referenced by Engines::KotOR::Creature::createFakePC(), Engines::KotOR::Creature::createPC(), Engines::KotOR::Module::enter(), Engines::KotOR::Item::getName(), getName(), Engines::KotOR::Item::load(), Engines::KotOR::Situated::load(), Engines::KotOR::Area::loadARE(), Engines::KotOR::Trigger::loadBlueprint(), Engines::KotOR::Module::loadIFO(), Engines::KotOR::Situated::loadProperties(), Engines::KotOR::Creature::loadProperties(), and Engines::KotOR::SoundObject::SoundObject().
|
protected |
The object's orientation.
Definition at line 157 of file object.h.
Referenced by getOrientation(), Engines::KotOR::Placeable::load(), Engines::KotOR::Door::load(), Object(), and setOrientation().
|
protected |
The object's portrait.
Definition at line 145 of file object.h.
Referenced by Engines::KotOR::Creature::createPC(), getPortrait(), Engines::KotOR::Situated::loadPortrait(), and Engines::KotOR::Creature::loadPortrait().
|
protected |
The object's position.
Definition at line 156 of file object.h.
Referenced by getPosition(), Engines::KotOR::Placeable::load(), Engines::KotOR::Door::load(), makeLookAt(), Object(), and setPosition().
|
protected |
|
protected |
The currently playing object sound.
Definition at line 159 of file object.h.
Referenced by playSound(), and stopSound().
|
protected |
Is the object static?
Definition at line 147 of file object.h.
Referenced by isClickable(), isStatic(), Engines::KotOR::Situated::loadProperties(), and Engines::KotOR::Creature::loadProperties().
|
protected |
|
protected |
Is the object usable?
Definition at line 148 of file object.h.
Referenced by isClickable(), isUsable(), Engines::KotOR::Situated::loadProperties(), and Engines::KotOR::Creature::loadProperties().