OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RuleCraftWeapon.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_RULECRAFTWEAPON_H
20 #define OPENXCOM_RULECRAFTWEAPON_H
21 
22 #include <string>
23 #include <yaml-cpp/yaml.h>
24 #include "../Savegame/CraftWeaponProjectile.h"
25 
26 namespace OpenXcom
27 {
28 
36 {
37 private:
38  std::string _type;
39  int _sprite, _sound, _damage, _range, _accuracy, _reloadCautious, _reloadStandard, _reloadAggressive, _ammoMax, _rearmRate, _projectileSpeed;
40  CraftWeaponProjectileType _projectileType;
41  std::string _launcher, _clip;
42 public:
44  RuleCraftWeapon(const std::string &type);
48  void load(const YAML::Node& node, int modIndex);
50  std::string getType() const;
52  int getSprite() const;
54  int getSound() const;
56  int getDamage() const;
58  int getRange() const;
60  int getAccuracy() const;
62  int getCautiousReload() const;
64  int getStandardReload() const;
66  int getAggressiveReload() const;
68  int getAmmoMax() const;
70  int getRearmRate() const;
72  std::string getLauncherItem() const;
74  std::string getClipItem() const;
76  CraftWeaponProjectileType getProjectileType() const;
78  int getProjectileSpeed() const;
79 };
80 
81 }
82 
83 #endif
int getRange() const
Gets the craft weapon's range.
Definition: RuleCraftWeapon.cpp:119
int getDamage() const
Gets the craft weapon's damage.
Definition: RuleCraftWeapon.cpp:110
int getProjectileSpeed() const
Gets the craft weapon's projectile speed.
Definition: RuleCraftWeapon.cpp:217
CraftWeaponProjectileType getProjectileType() const
Gets the craft weapon's projectile's type.
Definition: RuleCraftWeapon.cpp:208
RuleCraftWeapon(const std::string &type)
Creates a blank craft weapon ruleset.
Definition: RuleCraftWeapon.cpp:28
int getCautiousReload() const
Gets the craft weapon's cautious reload time.
Definition: RuleCraftWeapon.cpp:139
std::string getType() const
Gets the craft weapon's type.
Definition: RuleCraftWeapon.cpp:80
std::string getClipItem() const
Gets the craft weapon's clip item.
Definition: RuleCraftWeapon.cpp:199
~RuleCraftWeapon()
Cleans up the craft weapon ruleset.
Definition: RuleCraftWeapon.cpp:35
void load(const YAML::Node &node, int modIndex)
Loads craft weapon data from YAML.
Definition: RuleCraftWeapon.cpp:44
int getAggressiveReload() const
Gets the craft weapon's aggressive reload time.
Definition: RuleCraftWeapon.cpp:159
int getSprite() const
Gets the craft weapon's sprite.
Definition: RuleCraftWeapon.cpp:90
std::string getLauncherItem() const
Gets the craft weapon's launcher item.
Definition: RuleCraftWeapon.cpp:189
int getAccuracy() const
Gets the craft weapon's accuracy.
Definition: RuleCraftWeapon.cpp:129
int getRearmRate() const
Gets the craft weapon's rearm rate.
Definition: RuleCraftWeapon.cpp:179
int getSound() const
Gets the craft weapon's sound.
Definition: RuleCraftWeapon.cpp:100
Represents a specific type of craft weapon.
Definition: RuleCraftWeapon.h:35
int getStandardReload() const
Gets the craft weapon's standard reload time.
Definition: RuleCraftWeapon.cpp:149
int getAmmoMax() const
Gets the craft weapon's maximum ammo.
Definition: RuleCraftWeapon.cpp:169