43 _state(kStateDefault), _hasInventory(false) {
67 _model->setState(
"default");
141 _model->drawBound(enabled);
168 return close(triggerer);
170 return open(triggerer);
Class to hold the two-dimensional array of a 2DA file.
Handling version V3.2/V3.3 of BioWare's GFFs (generic file format).
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like 'DATA', to ensure portability.
uint32 _soundAppType
The index within the situated sounds 2DA.
void loadObject(const Aurora::GFF3Struct &gff)
Load placeable-specific properties.
const Common::UString & getString(size_t column) const
Return the contents of a cell as a string.
bool getBool(const Common::UString &field, bool def=false) const
void loadAppearance()
Load appearance-specific properties.
A class holding an UTF-8 string.
void reset(PointerType o=0)
Resets the pointer with the new value.
void hide()
Hide the placeable's model.
bool _hasInventory
Does this placeable have an inventory?
bool isOpen() const
Is the placeable open?
Placeable(const Aurora::GFF3Struct &placeable)
Load from a placeable instance.
void setModelState()
Sync the model's state with the placeable's state.
State _state
The current state of the placeable.
uint64 getUint(const Common::UString &field, uint64 def=0) const
Aurora::GFF3File * loadOptionalGFF3(const Common::UString &gff3, Aurora::FileType type, uint32 id, bool repairNWNPremium)
Load a GFF3, but return 0 instead of throwing on error.
bool isLocked() const
Is the situated object locked?
An object within a NWN2 area.
Object * _lastOpenedBy
The object that last opened this situated object.
A simple scoped smart pointer template.
Common::UString _soundClosed
The sound the object makes when closed.
void leave()
The cursor left the placeable.
Common::UString _modelName
The model's resource name.
void show()
Show the situated object's model.
Utility templates and functions.
void load(const Aurora::GFF3Struct &placeable)
Load from a placeable instance.
Placeable template (user), GFF.
Handling BioWare's 2DAs (two-dimensional array).
void highlight(bool enabled)
(Un)Highlight the placeable.
bool open(Object *opener)
The opener object opens this placeable.
bool empty() const
Is the string empty?
#define TwoDAReg
Shortcut for accessing the 2da registry.
int32 getInt(size_t column) const
Return the contents of a cell as an int.
bool deactivate(Object *closer)
The user object deactivates this placeable.
Common::ScopedPtr< Graphics::Aurora::Model > _model
The situated object's model.
uint32 _appearanceID
The index within the situated appearance 2DA.
void enter()
The cursor entered the placeable.
void playSound(const Common::UString &sound, bool pitchVariance=false)
Play an object sound.
State
The state of a placeable.
Common::UString _soundUsed
The sound the object makes when used.
const TwoDARow & getRow(size_t row) const
Get a row.
Object * _lastClosedBy
The object that last closed this situated object.
A placeable object in a Neverwinter Nights 2 area.
bool isActivated() const
Is the placeable activated?
Common::UString getString(const Common::UString &field, const Common::UString &def="") const
Object * _lastUsedBy
The object that last used this situated object.
void show()
Show the placeable's model.
Generic Aurora engines utility functions.
bool runScript(Script script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
void load(const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint=0)
Load the situated object from an instance and its blueprint.
void hide()
Hide the situated object's model.
Common::UString _soundOpened
The sound the object makes when opened.
Common::UString _soundLocked
The sound the object makes when locked.
bool click(Object *triggerer=0)
The placeable was clicked.
bool close(Object *closer)
The closer object closes this placeable.
void clear()
Clear the string's contents.
bool activate(Object *opener)
The user object activates this placeable.