xoreos  0.0.5
item.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_NWN_ITEM_H
26 #define ENGINES_NWN_ITEM_H
27 
28 #include "src/common/scopedptr.h"
29 
30 #include "src/aurora/types.h"
31 
33 
34 #include "src/engines/nwn/object.h"
35 
36 namespace Engines {
37 
38 namespace NWN {
39 
40 class Item : public Object {
41 public:
42  enum Color {
49 
51  };
52 
53  Item(const Aurora::GFF3Struct &item);
54  ~Item();
55 
56  // Basic visuals
57 
58  void loadModel();
59  void unloadModel();
60 
61  void show();
62  void hide();
63 
64  // Basic properties
65 
66  bool isArmor() const;
67 
68  uint32 getColor(Color color) const;
69  uint32 getArmorPart(size_t index) const;
70 
71 private:
93 
95  };
96 
98 
100 
103 
105 
106  void load(const Aurora::GFF3Struct &item);
107  void load(const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint);
108 
109  void loadProperties(const Aurora::GFF3Struct &gff);
110  void loadPortrait(const Aurora::GFF3Struct &gff);
111  void loadArmorParts(const Aurora::GFF3Struct &gff);
112 };
113 
114 } // End of namespace NWN
115 
116 } // End of namespace Engines
117 
118 #endif // ENGINES_NWN_ITEM_H
uint32 getArmorPart(size_t index) const
Definition: item.cpp:212
Item(const Aurora::GFF3Struct &item)
Definition: item.cpp:44
A class holding an UTF-8 string.
Definition: ustring.h:48
Common::UString _modelName
The model&#39;s resource name.
Definition: item.h:97
bool isArmor() const
Definition: item.cpp:200
void loadProperties(const Aurora::GFF3Struct &gff)
Definition: item.cpp:134
uint32 getColor(Color color) const
Definition: item.cpp:206
A simple scoped smart pointer template.
void loadArmorParts(const Aurora::GFF3Struct &gff)
Definition: item.cpp:180
Basic Aurora graphics types.
void hide()
Hide the item&#39;s model.
Definition: item.cpp:113
void show()
Show the item&#39;s model.
Definition: item.cpp:108
uint32 _armorParts[kArmorPartMAX]
The item&#39;s armor parts.
Definition: item.h:102
void unloadModel()
Unload the item&#39;s model.
Definition: item.cpp:102
An object in a Neverwinter Nights area.
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
A struct within a GFF3.
Definition: gff3file.h:164
uint32 _colors[kColorMAX]
The item&#39;s colors.
Definition: item.h:101
uint32_t uint32
Definition: types.h:204
Common::ScopedPtr< Graphics::Aurora::Model > _model
The item&#39;s model.
Definition: item.h:104
uint32 _baseItem
The index within the baseitem 2DA.
Definition: item.h:99
void load(const Aurora::GFF3Struct &item)
Definition: item.cpp:58
void loadModel()
Load the item&#39;s model.
Definition: item.cpp:70
ArmorPartType
Parts of an armor set.
Definition: item.h:73
void loadPortrait(const Aurora::GFF3Struct &gff)
Definition: item.cpp:167