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_KOTOR_PLACEABLE_H
26 #define ENGINES_KOTOR_PLACEABLE_H
27 
28 #include "src/aurora/types.h"
29 
31 #include "src/engines/kotor/item.h"
33 
34 namespace Engines {
35 
36 namespace KotOR {
37 
38 class Placeable : public Situated {
39 public:
41  enum State {
43  kStateOpen = 1,
48  };
49 
51  Placeable(const Aurora::GFF3Struct &placeable);
52  ~Placeable();
53 
54  // Basic visuals
55 
56  void hide();
57 
58  // Basic properties
59 
61  bool isOpen() const;
63  bool isActivated() const;
64 
66  bool open(Object *opener);
68  bool close(Object *closer);
69 
71  bool activate(Object *opener);
73  bool deactivate(Object *closer);
74 
75  // Inventory
76 
77  bool hasInventory();
79 
80  // Object/Cursor interactions
81 
82  void enter();
83  void leave();
84 
86  void highlight(bool enabled);
87 
89  bool click(Object *triggerer = 0);
90 
91 protected:
93  void loadObject(const Aurora::GFF3Struct &gff);
95  void loadAppearance();
96 
97 private:
99 
102 
104  void load(const Aurora::GFF3Struct &placeable);
105 };
106 
107 } // End of namespace KotOR
108 
109 } // End of namespace Engines
110 
111 #endif // ENGINES_KOTOR_PLACEABLE_H
void load(const Aurora::GFF3Struct &placeable)
Load from a placeable instance.
Definition: placeable.cpp:56
bool isOpen() const
Is the placeable open?
Definition: placeable.cpp:135
void highlight(bool enabled)
(Un)Highlight the placeable.
Definition: placeable.cpp:130
bool isActivated() const
Is the placeable activated?
Definition: placeable.cpp:139
bool _hasInventory
Does this placeable have an inventory?
Definition: placeable.h:100
void loadObject(const Aurora::GFF3Struct &gff)
Load placeable-specific properties.
Definition: placeable.cpp:85
void enter()
The cursor entered the placeable.
Definition: placeable.cpp:120
bool deactivate(Object *closer)
The user object deactivates this placeable.
Definition: placeable.cpp:232
Collection of items.
void loadAppearance()
Load appearance-specific properties.
Definition: placeable.cpp:110
bool open(Object *opener)
The opener object opens this placeable.
Definition: placeable.cpp:173
bool close(Object *closer)
The closer object closes this placeable.
Definition: placeable.cpp:195
Placeable(const Aurora::GFF3Struct &placeable)
Load from a placeable instance.
Definition: placeable.cpp:47
State _state
The current state of the placeable.
Definition: placeable.h:98
A situated object in a Star Wars: Knights of the Old Republic area.
Inventory & getInventory()
Definition: placeable.cpp:256
void leave()
The cursor left the placeable.
Definition: placeable.cpp:125
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
State
The state of a placeable.
Definition: placeable.h:41
A struct within a GFF3.
Definition: gff3file.h:164
bool click(Object *triggerer=0)
The placeable was clicked.
Definition: placeable.cpp:143
An item in a Star Wars: Knights of the Old Republic area.
Inventory _inventory
The current items of this placeable if it has an inventory.
Definition: placeable.h:101
bool activate(Object *opener)
The user object activates this placeable.
Definition: placeable.cpp:212
void hide()
Hide the placeable&#39;s model.
Definition: placeable.cpp:79