OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RuleCraft.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_RULECRAFT_H
20 #define OPENXCOM_RULECRAFT_H
21 
22 #include <vector>
23 #include <string>
24 #include <yaml-cpp/yaml.h>
25 
26 namespace OpenXcom
27 {
28 
29 class RuleTerrain;
30 class Ruleset;
31 
38 class RuleCraft
39 {
40 private:
41  std::string _type;
42  std::vector<std::string> _requires;
43  int _sprite;
44  int _fuelMax, _damageMax, _speedMax, _accel, _weapons, _soldiers, _vehicles, _costBuy, _costRent, _costSell;
45  std::string _refuelItem;
46  int _repairRate, _refuelRate, _radarRange, _transferTime, _score;
47  RuleTerrain *_battlescapeTerrainData;
48  bool _spacecraft;
49  int _listOrder;
50  std::vector<std::vector <int> > _deployment;
51 public:
53  RuleCraft(const std::string &type);
55  ~RuleCraft();
57  void load(const YAML::Node& node, Ruleset *ruleset, int modIndex, int nextCraftIndex);
59  std::string getType() const;
61  const std::vector<std::string> &getRequirements () const;
63  int getSprite() const;
65  int getMaxFuel() const;
67  int getMaxDamage() const;
69  int getMaxSpeed() const;
71  int getAcceleration() const;
73  int getWeapons() const;
75  int getSoldiers() const;
77  int getVehicles() const;
79  int getBuyCost() const;
81  int getRentCost() const;
83  int getSellCost() const;
85  std::string getRefuelItem() const;
87  int getRepairRate() const;
89  int getRefuelRate() const;
91  int getRadarRange() const;
93  int getTransferTime() const;
95  int getScore() const;
99  bool getSpacecraft() const;
101  int getListOrder() const;
103  std::vector<std::vector<int> > &getDeployment();
104 };
105 
106 }
107 
108 #endif
int getBuyCost() const
Gets the craft's cost.
Definition: RuleCraft.cpp:204
int getAcceleration() const
Gets the craft's acceleration.
Definition: RuleCraft.cpp:164
int getRentCost() const
Gets the craft's rent for a month.
Definition: RuleCraft.cpp:213
void load(const YAML::Node &node, Ruleset *ruleset, int modIndex, int nextCraftIndex)
Loads craft data from YAML.
Definition: RuleCraft.cpp:54
int getSellCost() const
Gets the craft's value.
Definition: RuleCraft.cpp:223
int getMaxSpeed() const
Gets the craft's maximum speed.
Definition: RuleCraft.cpp:154
int getMaxDamage() const
Gets the craft's maximum damage.
Definition: RuleCraft.cpp:144
~RuleCraft()
Cleans up the craft ruleset.
Definition: RuleCraft.cpp:42
int getWeapons() const
Gets the craft's weapon capacity.
Definition: RuleCraft.cpp:174
Set of rules and stats for a game.
Definition: Ruleset.h:69
int getSprite() const
Gets the craft's sprite.
Definition: RuleCraft.cpp:125
int getTransferTime() const
Gets the craft's transfer time.
Definition: RuleCraft.cpp:273
int getSoldiers() const
Gets the craft's soldier capacity.
Definition: RuleCraft.cpp:184
RuleTerrain * getBattlescapeTerrainData()
Gets the craft's terrain data.
Definition: RuleCraft.cpp:292
RuleCraft(const std::string &type)
Creates a blank craft ruleset.
Definition: RuleCraft.cpp:30
Represents a specific type of craft.
Definition: RuleCraft.h:38
const std::vector< std::string > & getRequirements() const
Gets the craft's requirements.
Definition: RuleCraft.cpp:115
int getRefuelRate() const
Gets the craft's refuel rate.
Definition: RuleCraft.cpp:253
bool getSpacecraft() const
Checks if this craft is capable of travelling to mars.
Definition: RuleCraft.cpp:301
int getRadarRange() const
Gets the craft's radar range.
Definition: RuleCraft.cpp:263
int getVehicles() const
Gets the craft's vehicle capacity.
Definition: RuleCraft.cpp:194
Represents a specific type of Battlescape Terrain.
Definition: RuleTerrain.h:41
std::string getRefuelItem() const
Gets the craft's refuel item.
Definition: RuleCraft.cpp:233
int getListOrder() const
Gets the list weight for this craft.
Definition: RuleCraft.cpp:310
int getMaxFuel() const
Gets the craft's maximum fuel.
Definition: RuleCraft.cpp:134
std::vector< std::vector< int > > & getDeployment()
Gets the deployment priority for the craft.
Definition: RuleCraft.cpp:320
int getRepairRate() const
Gets the craft's repair rate.
Definition: RuleCraft.cpp:243
int getScore() const
Gets the craft's score.
Definition: RuleCraft.cpp:283
std::string getType() const
Gets the craft's type.
Definition: RuleCraft.cpp:105