OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RuleBaseFacility.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_RULEBASEFACILITY_H
20 #define OPENXCOM_RULEBASEFACILITY_H
21 
22 #include <string>
23 #include <vector>
24 #include <yaml-cpp/yaml.h>
25 
26 namespace OpenXcom
27 {
28 
36 {
37 private:
38  std::string _type;
39  std::vector<std::string> _requires;
40  int _spriteShape, _spriteFacility;
41  bool _lift, _hyper, _mind, _grav;
42  int _size, _buildCost, _buildTime, _monthlyCost;
43  int _storage, _personnel, _aliens, _crafts, _labs, _workshops, _psiLabs;
44  int _radarRange, _radarChance, _defense, _hitRatio, _fireSound, _hitSound;
45  std::string _mapName;
46  int _listOrder;
47 public:
49  RuleBaseFacility(const std::string &type);
53  void load(const YAML::Node& node, int modIndex, int listOrder);
55  std::string getType() const;
57  const std::vector<std::string> &getRequirements() const;
59  int getSpriteShape() const;
61  int getSpriteFacility() const;
63  int getSize() const;
65  bool isLift() const;
67  bool isHyperwave() const;
69  bool isMindShield() const;
71  bool isGravShield() const;
73  int getBuildCost() const;
75  int getBuildTime() const;
77  int getMonthlyCost() const;
79  int getStorage() const;
81  int getPersonnel() const;
83  int getAliens() const;
85  int getCrafts() const;
87  int getLaboratories() const;
89  int getWorkshops() const;
91  int getPsiLaboratories() const;
93  int getRadarRange() const;
95  int getRadarChance() const;
97  int getDefenseValue() const;
99  int getHitRatio() const;
101  std::string getMapName() const;
103  int getFireSound() const;
105  int getHitSound() const;
107  int getListOrder() const;
108 };
109 
110 }
111 
112 #endif
const std::vector< std::string > & getRequirements() const
Gets the facility's requirements.
Definition: RuleBaseFacility.cpp:115
int getSpriteFacility() const
Gets the facility's content sprite.
Definition: RuleBaseFacility.cpp:135
int getLaboratories() const
Gets the facility's laboratory space.
Definition: RuleBaseFacility.cpp:264
RuleBaseFacility(const std::string &type)
Creates a blank facility ruleset.
Definition: RuleBaseFacility.cpp:29
int getFireSound() const
Gets the facility's fire sound.
Definition: RuleBaseFacility.cpp:352
bool isMindShield() const
Gets if the facility is a mind shield.
Definition: RuleBaseFacility.cpp:175
int getDefenseValue() const
Gets the facility's defense value.
Definition: RuleBaseFacility.cpp:314
int getPersonnel() const
Gets the facility's personnel capacity.
Definition: RuleBaseFacility.cpp:235
bool isLift() const
Gets if the facility is an access lift.
Definition: RuleBaseFacility.cpp:155
~RuleBaseFacility()
Cleans up the facility ruleset.
Definition: RuleBaseFacility.cpp:36
std::string getMapName() const
Gets the facility's battlescape map name.
Definition: RuleBaseFacility.cpp:334
int getPsiLaboratories() const
Gets the facility's psi-training capacity.
Definition: RuleBaseFacility.cpp:284
bool isGravShield() const
Gets if the facility is a grav shield.
Definition: RuleBaseFacility.cpp:185
int getSize() const
Gets the facility's size.
Definition: RuleBaseFacility.cpp:144
void load(const YAML::Node &node, int modIndex, int listOrder)
Loads the facility from YAML.
Definition: RuleBaseFacility.cpp:46
int getWorkshops() const
Gets the facility's workshop space.
Definition: RuleBaseFacility.cpp:274
int getAliens() const
Gets the facility's alien capacity.
Definition: RuleBaseFacility.cpp:245
bool isHyperwave() const
Gets if the facility has hyperwave detection.
Definition: RuleBaseFacility.cpp:165
int getBuildTime() const
Gets the facility's construction time.
Definition: RuleBaseFacility.cpp:205
std::string getType() const
Gets the facility's type.
Definition: RuleBaseFacility.cpp:105
int getRadarRange() const
Gets the facility's radar range.
Definition: RuleBaseFacility.cpp:294
int getSpriteShape() const
Gets the facility's shape sprite.
Definition: RuleBaseFacility.cpp:125
int getHitSound() const
Gets the facility's hit sound.
Definition: RuleBaseFacility.cpp:343
int getMonthlyCost() const
Gets the facility's monthly cost.
Definition: RuleBaseFacility.cpp:215
int getHitRatio() const
Gets the facility's weapon hit ratio.
Definition: RuleBaseFacility.cpp:324
int getCrafts() const
Gets the facility's craft capacity.
Definition: RuleBaseFacility.cpp:254
int getListOrder() const
Gets the facility's list weight.
Definition: RuleBaseFacility.cpp:361
int getStorage() const
Gets the facility's storage capacity.
Definition: RuleBaseFacility.cpp:225
int getRadarChance() const
Gets the facility's detection chance.
Definition: RuleBaseFacility.cpp:304
Represents a specific type of base facility.
Definition: RuleBaseFacility.h:35
int getBuildCost() const
Gets the facility's construction cost.
Definition: RuleBaseFacility.cpp:195