47 _state(kStateClosed), _linkedToFlag(kLinkedToNothing), _evaluatedLink(false),
48 _link(0), _linkedDoor(0), _linkedWaypoint(0) {
119 _model->setState(
"closed");
123 _model->setState(
"opened1");
127 _model->setState(
"opened2");
170 _model->drawBound(enabled);
189 return open(triggerer);
205 return close(triggerer);
315 _model->playAnimation(anim, restart, length, speed);
LinkedToFlag _linkedToFlag
Does this door link to anything?
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.
Door(Module &module, const Aurora::GFF3Struct &door)
Load from a door instance.
virtual void setLocked(bool locked)
Lock/Unlock the situated object.
This door links to a waypoint.
Common::UString getDoorAnimationName(Animation animation, bool alternate)
Return the name (as found in the models) of a specific door animation.
bool hasScript(Script script) const
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 reset(PointerType o=0)
Resets the pointer with the new value.
Object * _link
The object this door links to.
Opened in one direction (normally clock-wise).
Area * getArea() const
Return the area this object is currently in.
void movePC(const Common::UString &area)
Move the player character to this area.
void load(const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint=0)
Load the situated object from an instance and its blueprint.
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.
Common::UString _soundClosed
The sound the object makes when closed.
Common::ScopedPtr< Graphics::Aurora::Model > _model
The situated object's model.
void hide()
Hide the door's model.
const Common::UString & getAnimationSound(Animation animation)
virtual void playAnimation(const Common::UString &animation="", bool restart=true, float length=0.0f, float speed=1.0f)
Play an object animation.
void setModelState()
Sync the model's state with the door's state.
uint32 _genericType
Index into the generic door types.
The context needed to run a Neverwinter Nights module.
Waypoint * _linkedWaypoint
The waypoint this door links to.
Basic exceptions to throw.
This door links to another door.
virtual void getPosition(float &x, float &y, float &z) const
Return the object's position within its area.
void highlight(bool enabled)
(Un)Highlight the door.
Utility templates and functions.
Common::UString _soundOpened
The sound the object makes when opened.
State _state
The current state of the door.
Handling BioWare's 2DAs (two-dimensional array).
Opened in the other direction (normally counter-clock-wise).
void evaluateLink()
Evaluate our link.
Common::UString _soundLocked
The sound the object makes when locked.
Common::UString _soundDestroyed
The sound the object makes when destroyed.
void setLocked(bool locked)
Lock/Unlock the door.
bool open(Object *opener)
The opener object opens this door.
Module * _module
The module the door is in.
bool isOpen() const
Is the door open?
bool close(Object *closer)
The closer object closes this door.
void enter()
The cursor entered the door.
void show()
Show the door's model.
void playSound(const Common::UString &sound, bool pitchVariance=false)
Play an object sound.
Door * _linkedDoor
The door this door links to.
bool empty() const
Is the string empty?
#define TwoDAReg
Shortcut for accessing the 2da registry.
Object * _lastClosedBy
The object that last closed this situated object.
bool _invisible
Is the door invisible?
uint32 _appearanceID
The index within the situated appearance 2DA.
uint32 _soundAppType
The index within the situated sounds 2DA.
void leave()
The cursor left the door.
#define CursorMan
Shortcut for accessing the cursor manager.
int32 getInt(size_t column) const
Return the contents of a cell as an int.
Object * _lastUsedBy
The object that last used this situated object.
The Aurora cursor manager.
Common::UString _portrait
The object's portrait.
Object * _lastOpenedBy
The object that last opened this situated object.
bool _evaluatedLink
Have we already tried to evaluate our link?
const TwoDARow & getRow(size_t row) const
Get a row.
bool isAnimationLooping(Animation animation)
Return true if the specified animation allows looping.
bool isLocked() const
Is the situated object locked?
static const uint32 kFieldIDInvalid
void playAnimation(const Common::UString &animation="", bool restart=true, float length=0.0f, float speed=1.0f)
Play a door animation.
Common::UString _linkedTo
The object tag this door links to.
void loadAppearance()
Load appearance-specific properties.
Door template (user), GFF.
Common::UString getString(const Common::UString &field, const Common::UString &def="") const
Generic Aurora engines utility functions.
bool click(Object *triggerer=0)
The door was clicked.
A door in a Neverwinter Nights area.
State
The state of a door.
void clear()
Clear the string's contents.
bool runScript(Script script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
Object * getFirstObjectByTag(const Common::UString &tag) const
Return the first object with this tag.
void load(const Aurora::GFF3Struct &door)
Load from a door instance.
size_t headerToColumn(const Common::UString &header) const
Translate a column header to a column index.
A waypoint in a Neverwinter Nights area.
void show()
Show the situated object's model.
void hide()
Hide the situated object's model.
void loadObject(const Aurora::GFF3Struct &gff)
Load door-specific properties.
Common::UString _modelName
The model's resource name.