ScummVM API documentation
armor.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef ULTIMA4_GAME_ARMOR_H
23#define ULTIMA4_GAME_ARMOR_H
24
25#include "ultima/ultima4/filesys/savegame.h"
26#include "common/str.h"
27
28namespace Ultima {
29namespace Ultima4 {
30
31class ConfigElement;
32class Armors;
33
34class Armor {
35 friend class Armors;
36public:
37 // Getters
38 ArmorType getType() const {
39 return _type;
40 }
41 const Common::String &getName() const {
42 return _name;
43 }
44 int getDefense() const {
45 return _defense;
46 }
48 bool canWear(ClassType klass) const {
49 return _canUse & (1 << klass);
50 }
51
52private:
53 Armor(ArmorType armorType, const ConfigElement &conf);
54
55 ArmorType _type;
56 Common::String _name;
57 byte _canUse;
58 int _defense;
59 //unsigned short _mask;
60};
61
62class Armors : public Common::Array<Armor *> {
63private:
64 void loadConf();
65 bool _confLoaded;
66public:
71
76
80 const Armor *get(ArmorType a);
81
85 const Armor *get(const Common::String &name);
86};
87
88extern Armors *g_armors;
89
90} // End of namespace Ultima4
91} // End of namespace Ultima
92
93#endif
Definition: array.h:52
Definition: str.h:59
Definition: armor.h:34
ArmorType getType() const
Definition: armor.h:38
const Common::String & getName() const
Definition: armor.h:41
int getDefense() const
Definition: armor.h:44
bool canWear(ClassType klass) const
Definition: armor.h:48
Definition: armor.h:62
const Armor * get(const Common::String &name)
const Armor * get(ArmorType a)
Definition: config.h:126