OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Armor.h
1 /*
2  * Copyright 2010-2014 OpenXcom Developers.
3  *
4  * This file is part of OpenXcom.
5  *
6  * OpenXcom is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * OpenXcom is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPENXCOM_ARMOR_H
20 #define OPENXCOM_ARMOR_H
21 
22 #include <string>
23 #include <vector>
24 #include <yaml-cpp/yaml.h>
25 #include "MapData.h"
26 #include "Unit.h"
27 
28 namespace OpenXcom
29 {
30 
36 class Armor
37 {
38 public:
39  static const int DAMAGE_TYPES = 10;
40 private:
41  std::string _type, _spriteSheet, _spriteInv, _corpseGeo, _storeItem;
42  std::vector<std::string> _corpseBattle;
43  int _frontArmor, _sideArmor, _rearArmor, _underArmor, _drawingRoutine;
44  MovementType _movementType;
45  int _size, _weight;
46  float _damageModifier[DAMAGE_TYPES];
47  std::vector<int> _loftempsSet;
48  UnitStats _stats;
49 public:
51  Armor(const std::string &type);
53  ~Armor();
55  void load(const YAML::Node& node);
57  std::string getType() const;
59  std::string getSpriteSheet() const;
61  std::string getSpriteInventory() const;
63  int getFrontArmor() const;
65  int getSideArmor() const;
67  int getRearArmor() const;
69  int getUnderArmor() const;
71  std::string getCorpseGeoscape() const;
73  const std::vector<std::string> &getCorpseBattlescape() const;
75  std::string getStoreItem() const;
77  int getDrawingRoutine() const;
79  MovementType getMovementType() const;
81  int getSize() const;
83  float getDamageModifier(ItemDamageType dt);
85  std::vector<int> getLoftempsSet() const;
89  int getWeight();
90 };
91 
92 }
93 
94 #endif
int getSize() const
Gets whether this is a normal or big unit.
Definition: Armor.cpp:202
int getFrontArmor() const
Gets the front armor level.
Definition: Armor.cpp:118
std::string getSpriteInventory() const
Gets the unit's inventory sprite.
Definition: Armor.cpp:109
int getSideArmor() const
Gets the side armor level.
Definition: Armor.cpp:127
std::string getSpriteSheet() const
Gets the unit's sprite sheet.
Definition: Armor.cpp:100
float getDamageModifier(ItemDamageType dt)
Gets damage modifier.
Definition: Armor.cpp:212
Represents a specific type of armor.
Definition: Armor.h:36
~Armor()
Cleans up the armor ruleset.
Definition: Armor.cpp:38
This struct holds some plain unit attribute data together.
Definition: Unit.h:32
Armor(const std::string &type)
Creates a blank armor ruleset.
Definition: Armor.cpp:29
const std::vector< std::string > & getCorpseBattlescape() const
Gets the Battlescape corpse item.
Definition: Armor.cpp:165
std::string getType() const
Gets the armor's type.
Definition: Armor.cpp:91
UnitStats * getStats()
Gets the armor's stats.
Definition: Armor.cpp:229
int getRearArmor() const
Gets the rear armor level.
Definition: Armor.cpp:136
void load(const YAML::Node &node)
Loads the armor data from YAML.
Definition: Armor.cpp:47
MovementType getMovementType() const
Gets whether the armor can fly.
Definition: Armor.cpp:193
std::string getStoreItem() const
Gets the stores item.
Definition: Armor.cpp:174
int getUnderArmor() const
Gets the under armor level.
Definition: Armor.cpp:145
std::string getCorpseGeoscape() const
Gets the Geoscape corpse item.
Definition: Armor.cpp:155
std::vector< int > getLoftempsSet() const
Gets loftempSet.
Definition: Armor.cpp:220
int getDrawingRoutine() const
Gets the battlescape drawing routine ID.
Definition: Armor.cpp:183
int getWeight()
Gets the armor's weight.
Definition: Armor.cpp:238