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_WITCHER_SITUATED_H
26 #define ENGINES_WITCHER_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 Witcher {
39 
41 class Situated : public Object {
42 public:
43  ~Situated();
44 
45  // Basic visuals
46 
47  void loadModel();
48  void unloadModel();
49 
50  void show();
51  void hide();
52 
53  // Basic properties
54 
56  virtual bool isOpen() const = 0;
57 
58  bool isLocked() const;
59  virtual void setLocked(bool locked);
60 
62  Object *getLastOpenedBy() const;
64  Object *getLastClosedBy() const;
66  Object *getLastUsedBy () const;
67 
68  // Positioning
69 
71  void setPosition(float x, float y, float z);
73  void setOrientation(float x, float y, float z, float angle);
74 
75 protected:
77 
79 
80  bool _locked;
81 
87 
91 
93 
94 
95  Situated(ObjectType type);
96 
98  void load(const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint = 0);
99 
101  virtual void loadObject(const Aurora::GFF3Struct &gff) = 0;
102 
103 
104 private:
105  void loadProperties(const Aurora::GFF3Struct &gff);
106  void loadSounds();
107 };
108 
109 } // End of namespace Witcher
110 
111 } // End of namespace Engines
112 
113 #endif // ENGINES_WITCHER_SITUATED_H
Witcher situated object.
Definition: situated.h:41
void loadModel()
Load the situated object&#39;s model.
Definition: situated.cpp:54
Common::UString _soundUsed
The sound the object makes when used.
Definition: situated.h:85
void load(const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint=0)
Load the situated object from an instance and its blueprint.
Definition: situated.cpp:138
virtual bool isOpen() const =0
Is the situated object open?
A class holding an UTF-8 string.
Definition: ustring.h:48
An object within a Witcher area.
Definition: object.h:51
Common::ScopedPtr< Graphics::Aurora::Model > _model
The situated object&#39;s model.
Definition: situated.h:92
Object * getLastClosedBy() const
Return the object that last closed this situated object.
Definition: situated.cpp:130
Common::UString _modelName
The model&#39;s resource name.
Definition: situated.h:76
A simple scoped smart pointer template.
bool _locked
Is the situated object locked?
Definition: situated.h:80
Object * getLastOpenedBy() const
Return the object that last opened this situated object.
Definition: situated.cpp:126
Object * _lastUsedBy
The object that last used this situated object.
Definition: situated.h:90
virtual void setLocked(bool locked)
Lock/Unlock the situated object.
Definition: situated.cpp:122
Basic Aurora graphics types.
Common::UString _soundClosed
The sound the object makes when closed.
Definition: situated.h:83
uint32 _soundAppType
The index within the situated sounds 2DA.
Definition: situated.h:78
An object in a The Witcher area.
Common::UString _soundDestroyed
The sound the object makes when destroyed.
Definition: situated.h:84
Common::UString _soundLocked
The sound the object makes when locked.
Definition: situated.h:86
void loadProperties(const Aurora::GFF3Struct &gff)
Definition: situated.cpp:182
void setOrientation(float x, float y, float z, float angle)
Set the situated object&#39;s orientation.
Definition: situated.cpp:110
void unloadModel()
Unload the situated object&#39;s model.
Definition: situated.cpp:86
bool isLocked() const
Is the situated object locked?
Definition: situated.cpp:118
void setPosition(float x, float y, float z)
Set the situated object&#39;s position.
Definition: situated.cpp:102
Object * _lastOpenedBy
The object that last opened this situated object.
Definition: situated.h:88
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
void show()
Show the situated object&#39;s model.
Definition: situated.cpp:92
Object * _lastClosedBy
The object that last closed this situated object.
Definition: situated.h:89
A struct within a GFF3.
Definition: gff3file.h:164
uint32_t uint32
Definition: types.h:204
Common::UString _soundOpened
The sound the object makes when opened.
Definition: situated.h:82
Object * getLastUsedBy() const
Return the object that last used this situated object.
Definition: situated.cpp:134
virtual void loadObject(const Aurora::GFF3Struct &gff)=0
Load object-specific properties.
Situated(ObjectType type)
Definition: situated.cpp:45
void hide()
Hide the situated object&#39;s model.
Definition: situated.cpp:97