xoreos  0.0.5
door.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_DOOR_H
26 #define ENGINES_WITCHER_DOOR_H
27 
28 #include "src/aurora/types.h"
29 
31 
32 namespace Engines {
33 
34 namespace Witcher {
35 
36 class Module;
37 
38 class Waypoint;
39 
40 class Door : public Situated {
41 public:
43  enum State {
48  };
49 
51  Door(Module &module, const Aurora::GFF3Struct &door);
52  ~Door();
53 
54  // Basic visuals
55 
56  void show();
57  void hide();
58 
59  // Basic properties
60 
62  bool isOpen() const;
63 
65  bool open(Object *opener);
67  bool close(Object *closer);
68 
69  // Object/Cursor interactions
70 
71  void enter();
72  void leave();
73 
75  void highlight(bool enabled);
76 
78  bool click(Object *triggerer = 0);
79 
80 protected:
82  void loadObject(const Aurora::GFF3Struct &gff);
83 
84 private:
86 
88 
91 
93  void load(const Aurora::GFF3Struct &door);
94 
96  void setModelState();
97 };
98 
99 } // End of namespace Witcher
100 
101 } // End of namespace Engines
102 
103 #endif // ENGINES_WITCHER_DOOR_H
Witcher situated object.
Definition: situated.h:41
bool close(Object *closer)
The closer object closes this door.
Definition: door.cpp:167
State
The state of a door.
Definition: door.h:43
A class holding an UTF-8 string.
Definition: ustring.h:48
An object within a Witcher area.
Definition: object.h:51
void highlight(bool enabled)
(Un)Highlight the door.
Definition: door.cpp:120
Module * _module
The module the door is in.
Definition: door.h:85
void leave()
The cursor left the door.
Definition: door.cpp:116
State _state
The current state of the door.
Definition: door.h:87
Common::UString _linkedToModule
The module the waypoint this door links to is in.
Definition: door.h:90
A situated object in a The Witcher area.
void load(const Aurora::GFF3Struct &door)
Load from a door instance.
Definition: door.cpp:51
void hide()
Hide the door&#39;s model.
Definition: door.cpp:95
void setModelState()
Sync the model&#39;s state with the door&#39;s state.
Definition: door.cpp:61
void loadObject(const Aurora::GFF3Struct &gff)
Load door-specific properties.
Definition: door.cpp:101
Common::UString _linkedTo
The waypoint tag this door links to.
Definition: door.h:89
void show()
Show the door&#39;s model.
Definition: door.cpp:89
void enter()
The cursor entered the door.
Definition: door.cpp:112
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
A struct within a GFF3.
Definition: gff3file.h:164
Opened in one direction (normally clock-wise).
Definition: door.h:45
Opened in the other direction (normally counter-clock-wise).
Definition: door.h:46
Door(Module &module, const Aurora::GFF3Struct &door)
Load from a door instance.
Definition: door.cpp:42
bool isOpen() const
Is the door open?
Definition: door.cpp:181
bool open(Object *opener)
The opener object opens this door.
Definition: door.cpp:145
bool click(Object *triggerer=0)
The door was clicked.
Definition: door.cpp:125