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

#include <item.h>

Inheritance diagram for Engines::KotOR::Item:
Inheritance graph
[legend]
Collaboration diagram for Engines::KotOR::Item:
Collaboration graph
[legend]

Public Member Functions

 Item (const Common::UString &item)
 
const Common::UStringgetName () const
 
EquipmentSlot getEquipableSlots () const
 
int getBodyVariation () const
 
int getTextureVariation () const
 
const Common::UString getIcon () const
 
const Common::UString getModelName () const
 
- Public Member Functions inherited from Engines::KotOR::Object
 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::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...
 
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)
 
RoomgetRoom ()
 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::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::KotOR::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 &gff)
 

Private Attributes

int _baseItem
 
Common::UString _itemClass
 
EquipmentSlot _equipableSlots
 
int _modelVariation
 
int _bodyVariation
 
int _textureVariation
 

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)
 
- Protected Attributes inherited from Engines::KotOR::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...
 
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
 

Detailed Description

Definition at line 34 of file item.h.

Constructor & Destructor Documentation

◆ Item()

Engines::KotOR::Item::Item ( const Common::UString item)

Definition at line 39 of file item.cpp.

References Aurora::kFileTypeUTI, and load().

Here is the call graph for this function:

Member Function Documentation

◆ getBodyVariation()

int Engines::KotOR::Item::getBodyVariation ( ) const

Definition at line 72 of file item.cpp.

References _bodyVariation.

Referenced by Engines::KotOR::Creature::changeBody().

Here is the caller graph for this function:

◆ getEquipableSlots()

EquipmentSlot Engines::KotOR::Item::getEquipableSlots ( ) const

Definition at line 68 of file item.cpp.

References _equipableSlots.

Referenced by Engines::KotOR::MenuEquipment::fillEquipableItemsList().

Here is the caller graph for this function:

◆ getIcon()

const Common::UString Engines::KotOR::Item::getIcon ( ) const

◆ getModelName()

const Common::UString Engines::KotOR::Item::getModelName ( ) const

Definition at line 87 of file item.cpp.

References _itemClass, _modelVariation, Common::UString::c_str(), and Common::UString::format().

Referenced by Engines::KotOR::Creature::changeWeapon().

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

◆ getName()

const Common::UString & Engines::KotOR::Item::getName ( ) const

Definition at line 64 of file item.cpp.

References Engines::KotOR::Object::_name.

Referenced by Engines::KotOR::MenuEquipment::fillEquipableItemsList(), and Engines::KotOR::ContainerMenu::fillFromInventory().

Here is the caller graph for this function:

◆ getTextureVariation()

int Engines::KotOR::Item::getTextureVariation ( ) const

Definition at line 76 of file item.cpp.

References _textureVariation.

Referenced by Engines::KotOR::Creature::changeBody().

Here is the caller graph for this function:

◆ load()

void Engines::KotOR::Item::load ( const Aurora::GFF3Struct gff)
private

Member Data Documentation

◆ _baseItem

int Engines::KotOR::Item::_baseItem
private

Definition at line 47 of file item.h.

Referenced by load().

◆ _bodyVariation

int Engines::KotOR::Item::_bodyVariation
private

Definition at line 52 of file item.h.

Referenced by getBodyVariation(), and load().

◆ _equipableSlots

EquipmentSlot Engines::KotOR::Item::_equipableSlots
private

Definition at line 49 of file item.h.

Referenced by getEquipableSlots(), and load().

◆ _itemClass

Common::UString Engines::KotOR::Item::_itemClass
private

Definition at line 48 of file item.h.

Referenced by getIcon(), getModelName(), and load().

◆ _modelVariation

int Engines::KotOR::Item::_modelVariation
private

Definition at line 51 of file item.h.

Referenced by getIcon(), getModelName(), and load().

◆ _textureVariation

int Engines::KotOR::Item::_textureVariation
private

Definition at line 53 of file item.h.

Referenced by getIcon(), getTextureVariation(), and load().


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