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_KOTOR2_PLACEABLE_H
26 #define ENGINES_KOTOR2_PLACEABLE_H
27 
28 #include "src/aurora/types.h"
29 
31 
32 namespace Engines {
33 
34 namespace KotOR2 {
35 
36 class Placeable : public Situated {
37 public:
39  enum State {
41  kStateOpen = 1,
46  };
47 
49  Placeable(const Aurora::GFF3Struct &placeable);
50  ~Placeable();
51 
52  // Basic visuals
53 
54  void hide();
55 
56  // Basic properties
57 
59  bool isOpen() const;
61  bool isActivated() const;
62 
64  bool open(Object *opener);
66  bool close(Object *closer);
67 
69  bool activate(Object *opener);
71  bool deactivate(Object *closer);
72 
73  // Object/Cursor interactions
74 
75  void enter();
76  void leave();
77 
79  void highlight(bool enabled);
80 
82  bool click(Object *triggerer = 0);
83 
84 protected:
86  void loadObject(const Aurora::GFF3Struct &gff);
88  void loadAppearance();
89 
90 private:
92 
94 
96  void load(const Aurora::GFF3Struct &placeable);
97 };
98 
99 } // End of namespace KotOR2
100 
101 } // End of namespace Engines
102 
103 #endif // ENGINES_KOTOR2_PLACEABLE_H
bool click(Object *triggerer=0)
The placeable was clicked.
Definition: placeable.cpp:121
bool isActivated() const
Is the placeable activated?
Definition: placeable.cpp:117
bool activate(Object *opener)
The user object activates this placeable.
Definition: placeable.cpp:188
void hide()
Hide the placeable&#39;s model.
Definition: placeable.cpp:76
State _state
The current state of the placeable.
Definition: placeable.h:91
bool close(Object *closer)
The closer object closes this placeable.
Definition: placeable.cpp:171
State
The state of a placeable.
Definition: placeable.h:39
void enter()
The cursor entered the placeable.
Definition: placeable.cpp:100
Placeable(const Aurora::GFF3Struct &placeable)
Load from a placeable instance.
Definition: placeable.cpp:46
void highlight(bool enabled)
(Un)Highlight the placeable.
Definition: placeable.cpp:108
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
A situated object in a Star Wars: Knights of the Old Republic II - The Sith Lords area...
void leave()
The cursor left the placeable.
Definition: placeable.cpp:104
A struct within a GFF3.
Definition: gff3file.h:164
void loadAppearance()
Load appearance-specific properties.
Definition: placeable.cpp:90
bool _hasInventory
Does this placeable have an inventory?
Definition: placeable.h:93
bool isOpen() const
Is the placeable open?
Definition: placeable.cpp:113
bool deactivate(Object *closer)
The user object deactivates this placeable.
Definition: placeable.cpp:208
bool open(Object *opener)
The opener object opens this placeable.
Definition: placeable.cpp:149
void loadObject(const Aurora::GFF3Struct &gff)
Load placeable-specific properties.
Definition: placeable.cpp:82
void load(const Aurora::GFF3Struct &placeable)
Load from a placeable instance.
Definition: placeable.cpp:55