forked from OpenXcom/OpenXcom
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRuleCraft.h
More file actions
116 lines (112 loc) · 3.61 KB
/
Copy pathRuleCraft.h
File metadata and controls
116 lines (112 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#pragma once
/*
* Copyright 2010-2016 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenXcom is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
*/
#include <vector>
#include <string>
#include <yaml-cpp/yaml.h>
namespace OpenXcom
{
class RuleTerrain;
class Mod;
/**
* Represents a specific type of craft.
* Contains constant info about a craft like
* costs, speed, capacities, consumptions, etc.
* @sa Craft
*/
class RuleCraft
{
private:
std::string _type;
std::vector<std::string> _requires;
int _sprite, _marker;
int _fuelMax, _damageMax, _speedMax, _accel, _weapons, _soldiers, _vehicles, _costBuy, _costRent, _costSell;
std::string _refuelItem;
int _repairRate, _refuelRate, _radarRange, _radarChance, _sightRange, _transferTime, _score;
RuleTerrain *_battlescapeTerrainData;
bool _spacecraft;
int _listOrder, _maxItems, _maxAltitude;
std::vector<std::vector <int> > _deployment;
public:
/// Creates a blank craft ruleset.
RuleCraft(const std::string &type);
/// Cleans up the craft ruleset.
~RuleCraft();
/// Loads craft data from YAML.
void load(const YAML::Node& node, Mod *mod, int listOrder);
/// Gets the craft's type.
std::string getType() const;
/// Gets the craft's requirements.
const std::vector<std::string> &getRequirements() const;
/// Gets the craft's sprite.
int getSprite() const;
/// Gets the craft's globe marker.
int getMarker() const;
/// Gets the craft's maximum fuel.
int getMaxFuel() const;
/// Gets the craft's maximum damage.
int getMaxDamage() const;
/// Gets the craft's maximum speed.
int getMaxSpeed() const;
/// Gets the craft's acceleration.
int getAcceleration() const;
/// Gets the craft's weapon capacity.
unsigned int getWeapons() const;
/// Gets the craft's soldier capacity.
int getSoldiers() const;
/// Gets the craft's vehicle capacity.
int getVehicles() const;
/// Gets the craft's cost.
int getBuyCost() const;
/// Gets the craft's rent for a month.
int getRentCost() const;
/// Gets the craft's value.
int getSellCost() const;
/// Gets the craft's refuel item.
std::string getRefuelItem() const;
/// Gets the craft's repair rate.
int getRepairRate() const;
/// Gets the craft's refuel rate.
int getRefuelRate() const;
/// Gets the craft's radar range.
int getRadarRange() const;
/// Gets the craft's radar chance.
inline int getRadarChance() const {return _radarChance;}
/// Gets the craft's sight range.
int getSightRange() const;
/// Gets the craft's transfer time.
int getTransferTime() const;
/// Gets the craft's score.
int getScore() const;
/// Gets the craft's terrain data.
RuleTerrain *getBattlescapeTerrainData();
/// Checks if this craft is capable of travelling to mars.
bool getSpacecraft() const;
/// Gets the list weight for this craft.
int getListOrder() const;
/// Gets the deployment priority for the craft.
std::vector<std::vector<int> > &getDeployment();
/// Gets the item limit for this craft.
int getMaxItems() const;
/// Gets how high this craft can go.
int getMaxAltitude() const;
/// Gets if this craft only fights on water.
bool isWaterOnly() const;
};
}