xoreos  0.0.5
placeable.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_JADE_PLACEABLE_H
26 #define ENGINES_JADE_PLACEABLE_H
27 
28 #include "src/common/scopedptr.h"
29 
30 #include "src/aurora/types.h"
31 
33 
35 
36 namespace Engines {
37 
38 namespace Jade {
39 
40 class Placeable : public Object {
41 public:
43  Placeable(const Aurora::GFF3Struct &placeable);
44  ~Placeable();
45 
46  // Basic visuals
47 
48  void show();
49  void hide();
50 
51  // Basic properties
52 
54  bool open(Object *opener);
56  bool close(Object *closer);
57 
58  // Object/Cursor interactions
59 
60  void enter();
61  void leave();
62 
64  virtual void highlight(bool enabled);
65 
66 protected:
70 
72 
75 
77 
80 
81 private:
83  void load(const Aurora::GFF3Struct &placeable);
85  void loadBlueprint(const Aurora::GFF3Struct &gff);
87  void loadInstance(const Aurora::GFF3Struct &gff);
89  void loadProperties();
91  void loadAppearance();
93  int32 nextState(const Common::UString &input);
94 };
95 
96 } // End of namespace Jade
97 
98 } // End of namespace Engines
99 
100 #endif // ENGINES_JADE_PLACEABLE_H
An object within a Jade Empire area.
void loadInstance(const Aurora::GFF3Struct &gff)
Load the placeable&#39;s instance properties.
Definition: placeable.cpp:114
A class holding an UTF-8 string.
Definition: ustring.h:48
void hide()
Hide the placeable&#39;s model.
Definition: placeable.cpp:58
Common::UString _resRef
The placeable&#39;s description resref.
Definition: placeable.h:69
A simple scoped smart pointer template.
void leave()
The cursor left the placeable.
Definition: placeable.cpp:174
bool close(Object *closer)
The closer object closes this placeable.
Definition: placeable.cpp:200
int32 _state
The placeable&#39;s current state.
Definition: placeable.h:78
void loadBlueprint(const Aurora::GFF3Struct &gff)
Load the placeable&#39;s blueprint properties.
Definition: placeable.cpp:85
Common::ScopedPtr< Graphics::Aurora::Model > _model
The placeable&#39;s model.
Definition: placeable.h:76
Basic Aurora graphics types.
Common::ScopedPtr< Aurora::GFF3File > _fsm
The placeable&#39;s state file.
Definition: placeable.h:79
void show()
Show the placeable&#39;s model.
Definition: placeable.cpp:53
bool open(Object *opener)
The opener object opens this placeable.
Definition: placeable.cpp:183
void loadAppearance()
Load appearance-specific properties.
Definition: placeable.cpp:141
Common::UString _soundCue
The placeable&#39;s sound cue.
Definition: placeable.h:68
An object within a Jade area.
Definition: object.h:53
virtual void highlight(bool enabled)
(Un)Highlight the placeable.
Definition: placeable.cpp:178
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
int32 nextState(const Common::UString &input)
Determines the result State according to the state model.
Definition: placeable.cpp:215
A struct within a GFF3.
Definition: gff3file.h:164
uint32 _appearanceType
The index within the placeable 2DA.
Definition: placeable.h:71
uint32_t uint32
Definition: types.h:204
Placeable(const Aurora::GFF3Struct &placeable)
Load from a placeable instance.
Definition: placeable.cpp:44
Common::UString _modelName
The model&#39;s resource name.
Definition: placeable.h:67
void enter()
The cursor entered the placeable.
Definition: placeable.cpp:170
void loadProperties()
Load properties from placeable.2da.
Definition: placeable.cpp:99
Object * _lastClosedBy
The object that last closed this placeable object.
Definition: placeable.h:74
Object * _lastOpenedBy
The object that last opened this placeable object.
Definition: placeable.h:73
void load(const Aurora::GFF3Struct &placeable)
Load from a placeable instance.
Definition: placeable.cpp:64
int32_t int32
Definition: types.h:203