OpenXcom  1.0
Open-source clone of the original X-Com
RuleCraftWeapon.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom 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  * OpenXcom 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 OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include <string>
21 #include <yaml-cpp/yaml.h>
22 #include "../Savegame/CraftWeaponProjectile.h"
23 
24 namespace OpenXcom
25 {
26 
27 class Mod;
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  bool _underwaterOnly;
43 public:
45  RuleCraftWeapon(const std::string &type);
49  void load(const YAML::Node& node, Mod *mod);
51  std::string getType() const;
53  int getSprite() const;
55  int getSound() const;
57  int getDamage() const;
59  int getRange() const;
61  int getAccuracy() const;
63  int getCautiousReload() const;
65  int getStandardReload() const;
67  int getAggressiveReload() const;
69  int getAmmoMax() const;
71  int getRearmRate() const;
73  std::string getLauncherItem() const;
75  std::string getClipItem() const;
77  CraftWeaponProjectileType getProjectileType() const;
79  int getProjectileSpeed() const;
81  bool isWaterOnly() const;
82 };
83 
84 }
std::string getLauncherItem() const
Gets the craft weapon&#39;s launcher item.
Definition: RuleCraftWeapon.cpp:186
CraftWeaponProjectileType getProjectileType() const
Gets the craft weapon&#39;s projectile&#39;s type.
Definition: RuleCraftWeapon.cpp:205
int getDamage() const
Gets the craft weapon&#39;s damage.
Definition: RuleCraftWeapon.cpp:107
Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.
Definition: Mod.h:87
RuleCraftWeapon(const std::string &type)
Creates a blank craft weapon ruleset.
Definition: RuleCraftWeapon.cpp:29
std::string getType() const
Gets the craft weapon&#39;s type.
Definition: RuleCraftWeapon.cpp:77
int getProjectileSpeed() const
Gets the craft weapon&#39;s projectile speed.
Definition: RuleCraftWeapon.cpp:214
std::string getClipItem() const
Gets the craft weapon&#39;s clip item.
Definition: RuleCraftWeapon.cpp:196
int getAccuracy() const
Gets the craft weapon&#39;s accuracy.
Definition: RuleCraftWeapon.cpp:126
int getSprite() const
Gets the craft weapon&#39;s sprite.
Definition: RuleCraftWeapon.cpp:87
int getAggressiveReload() const
Gets the craft weapon&#39;s aggressive reload time.
Definition: RuleCraftWeapon.cpp:156
int getSound() const
Gets the craft weapon&#39;s sound.
Definition: RuleCraftWeapon.cpp:97
~RuleCraftWeapon()
Cleans up the craft weapon ruleset.
Definition: RuleCraftWeapon.cpp:36
void load(const YAML::Node &node, Mod *mod)
Loads craft weapon data from YAML.
Definition: RuleCraftWeapon.cpp:45
int getRearmRate() const
Gets the craft weapon&#39;s rearm rate.
Definition: RuleCraftWeapon.cpp:176
bool isWaterOnly() const
Is this item restricted to use underwater?
Definition: RuleCraftWeapon.cpp:223
int getAmmoMax() const
Gets the craft weapon&#39;s maximum ammo.
Definition: RuleCraftWeapon.cpp:166
int getStandardReload() const
Gets the craft weapon&#39;s standard reload time.
Definition: RuleCraftWeapon.cpp:146
int getCautiousReload() const
Gets the craft weapon&#39;s cautious reload time.
Definition: RuleCraftWeapon.cpp:136
Represents a specific type of craft weapon.
Definition: RuleCraftWeapon.h:35
Definition: BaseInfoState.cpp:40
int getRange() const
Gets the craft weapon&#39;s range.
Definition: RuleCraftWeapon.cpp:116