xoreos  0.0.5
situated.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_NWN2_SITUATED_H
26 #define ENGINES_NWN2_SITUATED_H
27 
28 #include "src/common/scopedptr.h"
29 
30 #include "src/aurora/types.h"
31 
33 
35 
36 namespace Engines {
37 
38 namespace NWN2 {
39 
40 class Situated : public Object {
41 public:
42  ~Situated();
43 
44  // Basic visuals
45 
46  void loadModel();
47  void unloadModel();
48 
49  void show();
50  void hide();
51 
52  // Basic properties
53 
55  virtual bool isOpen() const = 0;
56 
57  bool isLocked() const;
58  virtual void setLocked(bool locked);
59 
61  Object *getLastOpenedBy() const;
63  Object *getLastClosedBy() const;
65  Object *getLastUsedBy () const;
66 
67  // Positioning
68 
70  void setPosition(float x, float y, float z);
72  void setOrientation(float x, float y, float z, float angle);
73 
74 protected:
76 
79 
80  bool _locked;
81 
87 
88  float _tint[3][4];
89 
93 
95 
96 
97  Situated(ObjectType type);
98 
100  void load(const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint = 0);
101 
103  virtual void loadObject(const Aurora::GFF3Struct &gff) = 0;
105  virtual void loadAppearance() = 0;
106 
107 
108 private:
109  void loadProperties(const Aurora::GFF3Struct &gff);
110  void loadSounds();
111 };
112 
113 } // End of namespace NWN2
114 
115 } // End of namespace Engines
116 
117 #endif // ENGINES_NWN2_SITUATED_H
uint32 _soundAppType
The index within the situated sounds 2DA.
Definition: situated.h:78
Situated(ObjectType type)
Definition: situated.cpp:47
A class holding an UTF-8 string.
Definition: ustring.h:48
void loadModel()
Load the situated object&#39;s model.
Definition: situated.cpp:59
bool isLocked() const
Is the situated object locked?
Definition: situated.cpp:127
An object within a NWN2 area.
Definition: object.h:58
void setPosition(float x, float y, float z)
Set the situated object&#39;s position.
Definition: situated.cpp:111
Object * _lastOpenedBy
The object that last opened this situated object.
Definition: situated.h:90
A simple scoped smart pointer template.
Common::UString _soundClosed
The sound the object makes when closed.
Definition: situated.h:83
Object * getLastOpenedBy() const
Return the object that last opened this situated object.
Definition: situated.cpp:135
bool _locked
Is the situated object locked?
Definition: situated.h:80
Common::UString _modelName
The model&#39;s resource name.
Definition: situated.h:75
void show()
Show the situated object&#39;s model.
Definition: situated.cpp:101
Basic Aurora graphics types.
void unloadModel()
Unload the situated object&#39;s model.
Definition: situated.cpp:95
void loadProperties(const Aurora::GFF3Struct &gff)
Definition: situated.cpp:208
Common::ScopedPtr< Graphics::Aurora::Model > _model
The situated object&#39;s model.
Definition: situated.h:94
uint32 _appearanceID
The index within the situated appearance 2DA.
Definition: situated.h:77
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
Common::UString _soundUsed
The sound the object makes when used.
Definition: situated.h:85
virtual bool isOpen() const =0
Is the situated object open?
A struct within a GFF3.
Definition: gff3file.h:164
uint32_t uint32
Definition: types.h:204
Object * _lastClosedBy
The object that last closed this situated object.
Definition: situated.h:91
Object * getLastUsedBy() const
Return the object that last used this situated object.
Definition: situated.cpp:143
An object in a Neverwinter Nights 2 area.
Object * _lastUsedBy
The object that last used this situated object.
Definition: situated.h:92
virtual void loadObject(const Aurora::GFF3Struct &gff)=0
Load object-specific properties.
Common::UString _soundDestroyed
The sound the object makes when destroyed.
Definition: situated.h:84
ObjectType
Object type, matches the bitfield in nwscript.nss.
Definition: types.h:35
Object * getLastClosedBy() const
Return the object that last closed this situated object.
Definition: situated.cpp:139
void load(const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint=0)
Load the situated object from an instance and its blueprint.
Definition: situated.cpp:147
float _tint[3][4]
Definition: situated.h:88
void hide()
Hide the situated object&#39;s model.
Definition: situated.cpp:106
virtual void setLocked(bool locked)
Lock/Unlock the situated object.
Definition: situated.cpp:131
Common::UString _soundOpened
The sound the object makes when opened.
Definition: situated.h:82
Common::UString _soundLocked
The sound the object makes when locked.
Definition: situated.h:86
void setOrientation(float x, float y, float z, float angle)
Set the situated object&#39;s orientation.
Definition: situated.cpp:119
virtual void loadAppearance()=0
Load appearance-specific properties.