47 _state(kStateClosed), _linkedToFlag(kLinkedToNothing), _evaluatedLink(false),
48 _link(0), _linkedDoor(0), _linkedWaypoint(0) {
117 _model->setState(
"closed");
121 _model->setState(
"opened1");
125 _model->setState(
"opened2");
161 _model->drawBound(enabled);
180 return open(triggerer);
198 return close(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.
bool _evaluatedLink
Have we already tried to evaluate our link?
const Common::UString & getString(size_t column) const
Return the contents of a cell as a string.
A class holding an UTF-8 string.
void setLocked(bool locked)
Lock/Unlock the door.
Area * getArea() const
Return the area this object is currently in.
void reset(PointerType o=0)
Resets the pointer with the new value.
Opened in one direction (normally clock-wise).
Common::UString _linkedTo
The object tag this door links to.
void highlight(bool enabled)
(Un)Highlight the door.
This door links to another door.
Waypoint * _linkedWaypoint
The waypoint this door links to.
uint64 getUint(const Common::UString &field, uint64 def=0) const
bool isOpen() const
Is the door open?
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.
void leave()
The cursor left the door.
Opened in the other direction (normally counter-clock-wise).
bool isLocked() const
Is the situated object locked?
An object within a NWN2 area.
State
The state of a door.
void enter()
The cursor entered the door.
Object * _lastOpenedBy
The object that last opened this situated object.
void loadObject(const Aurora::GFF3Struct &gff)
Load door-specific properties.
A simple scoped smart pointer template.
Common::UString _soundClosed
The sound the object makes when closed.
bool click(Object *triggerer=0)
The door was clicked.
bool open(Object *opener)
The opener object opens this door.
The context needed to run a Neverwinter Nights 2 module.
Door * _linkedDoor
The door this door links to.
Basic exceptions to throw.
Common::UString _modelName
The model's resource name.
void show()
Show the situated object's model.
Utility templates and functions.
LinkedToFlag _linkedToFlag
Does this door link to anything?
Handling BioWare's 2DAs (two-dimensional array).
This door links to a waypoint.
Door(Module &module, const Aurora::GFF3Struct &door)
Load from a door instance.
Module * _module
The module the door is in.
void load(const Aurora::GFF3Struct &door)
Load from a door instance.
State _state
The current state of the door.
bool empty() const
Is the string empty?
#define TwoDAReg
Shortcut for accessing the 2da registry.
Object * _link
The object this door links to.
void movePC(const Common::UString &area)
Move the player character to this area.
void evaluateLink()
Evaluate our link.
int32 getInt(size_t column) const
Return the contents of a cell as an int.
void setModelState()
Sync the model's state with the door's state.
uint32 _genericType
Index into the generic door types.
Common::ScopedPtr< Graphics::Aurora::Model > _model
The situated object's model.
uint32 _appearanceID
The index within the situated appearance 2DA.
void playSound(const Common::UString &sound, bool pitchVariance=false)
Play an object sound.
const TwoDARow & getRow(size_t row) const
Get a row.
Object * _lastClosedBy
The object that last closed this situated object.
void hide()
Hide the door's model.
A door in a Neverwinter Nights 2 area.
static const uint32 kFieldIDInvalid
void show()
Show the door's model.
virtual void getPosition(float &x, float &y, float &z) const
Return the object's position within its area.
Door template (user), GFF.
Common::UString getString(const Common::UString &field, const Common::UString &def="") const
Object * _lastUsedBy
The object that last used this situated object.
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.
bool close(Object *closer)
The closer object closes this door.
void hide()
Hide the situated object's model.
virtual void setLocked(bool locked)
Lock/Unlock the situated object.
Common::UString _soundOpened
The sound the object makes when opened.
void loadAppearance()
Load appearance-specific properties.
Common::UString _soundLocked
The sound the object makes when locked.
void clear()
Clear the string's contents.
bool _invisible
Is the door invisible?
Object * getFirstObjectByTag(const Common::UString &tag) const
Return the first object with this tag.
bool hasScript(Script script) const
A waypoint in a Neverwinter Nights 2 area.