OpenXcom  1.0
Open-source clone of the original X-Com
RuleBaseFacility.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 <vector>
22 #include <yaml-cpp/yaml.h>
23 
24 namespace OpenXcom
25 {
26 
27 class Mod;
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, Mod *mod, 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 }
std::string getMapName() const
Gets the facility&#39;s battlescape map name.
Definition: RuleBaseFacility.cpp:329
int getSize() const
Gets the facility&#39;s size.
Definition: RuleBaseFacility.cpp:139
bool isHyperwave() const
Gets if the facility has hyperwave detection.
Definition: RuleBaseFacility.cpp:160
int getFireSound() const
Gets the facility&#39;s fire sound.
Definition: RuleBaseFacility.cpp:347
int getHitSound() const
Gets the facility&#39;s hit sound.
Definition: RuleBaseFacility.cpp:338
int getCrafts() const
Gets the facility&#39;s craft capacity.
Definition: RuleBaseFacility.cpp:249
RuleBaseFacility(const std::string &type)
Creates a blank facility ruleset.
Definition: RuleBaseFacility.cpp:30
Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.
Definition: Mod.h:87
int getDefenseValue() const
Gets the facility&#39;s defense value.
Definition: RuleBaseFacility.cpp:309
const std::vector< std::string > & getRequirements() const
Gets the facility&#39;s requirements.
Definition: RuleBaseFacility.cpp:110
bool isGravShield() const
Gets if the facility is a grav shield.
Definition: RuleBaseFacility.cpp:180
void load(const YAML::Node &node, Mod *mod, int listOrder)
Loads the facility from YAML.
Definition: RuleBaseFacility.cpp:47
int getSpriteShape() const
Gets the facility&#39;s shape sprite.
Definition: RuleBaseFacility.cpp:120
int getAliens() const
Gets the facility&#39;s alien capacity.
Definition: RuleBaseFacility.cpp:240
std::string getType() const
Gets the facility&#39;s type.
Definition: RuleBaseFacility.cpp:100
bool isLift() const
Gets if the facility is an access lift.
Definition: RuleBaseFacility.cpp:150
int getWorkshops() const
Gets the facility&#39;s workshop space.
Definition: RuleBaseFacility.cpp:269
~RuleBaseFacility()
Cleans up the facility ruleset.
Definition: RuleBaseFacility.cpp:37
bool isMindShield() const
Gets if the facility is a mind shield.
Definition: RuleBaseFacility.cpp:170
int getPersonnel() const
Gets the facility&#39;s personnel capacity.
Definition: RuleBaseFacility.cpp:230
int getListOrder() const
Gets the facility&#39;s list weight.
Definition: RuleBaseFacility.cpp:356
int getBuildCost() const
Gets the facility&#39;s construction cost.
Definition: RuleBaseFacility.cpp:190
int getHitRatio() const
Gets the facility&#39;s weapon hit ratio.
Definition: RuleBaseFacility.cpp:319
int getLaboratories() const
Gets the facility&#39;s laboratory space.
Definition: RuleBaseFacility.cpp:259
int getStorage() const
Gets the facility&#39;s storage capacity.
Definition: RuleBaseFacility.cpp:220
int getRadarRange() const
Gets the facility&#39;s radar range.
Definition: RuleBaseFacility.cpp:289
int getBuildTime() const
Gets the facility&#39;s construction time.
Definition: RuleBaseFacility.cpp:200
int getMonthlyCost() const
Gets the facility&#39;s monthly cost.
Definition: RuleBaseFacility.cpp:210
int getPsiLaboratories() const
Gets the facility&#39;s psi-training capacity.
Definition: RuleBaseFacility.cpp:279
int getSpriteFacility() const
Gets the facility&#39;s content sprite.
Definition: RuleBaseFacility.cpp:130
int getRadarChance() const
Gets the facility&#39;s detection chance.
Definition: RuleBaseFacility.cpp:299
Definition: BaseInfoState.cpp:40
Represents a specific type of base facility.
Definition: RuleBaseFacility.h:35