OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
EquipmentLayoutItem.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_EQUIPMENTLAYOUTITEM_H
20 #define OPENXCOM_EQUIPMENTLAYOUTITEM_H
21 
22 #include <string>
23 #include <yaml-cpp/yaml.h>
24 
25 namespace OpenXcom
26 {
27 
33 {
34 private:
35  std::string _itemType;
36  std::string _slot;
37  int _slotX, _slotY;
38  std::string _ammoItem;
39  int _fuseTimer;
40 public:
42  EquipmentLayoutItem(const YAML::Node& node);
44  EquipmentLayoutItem(std::string itemType, std::string slot, int slotX, int slotY, std::string ammoItem, int fuseTimer);
48  std::string getItemType() const;
50  std::string getSlot() const;
52  int getSlotX() const;
54  int getSlotY() const;
56  std::string getAmmoItem() const;
58  int getFuseTimer() const;
60  void load(const YAML::Node& node);
62  YAML::Node save() const;
63 };
64 
65 }
66 
67 #endif
EquipmentLayoutItem(const YAML::Node &node)
Creates a new soldier-equipment layout item and loads its contents from YAML.
Definition: EquipmentLayoutItem.cpp:28
Represents a soldier-equipment layout item which is used on the beginning of the Battlescape.
Definition: EquipmentLayoutItem.h:32
std::string getSlot() const
Gets the slot to be occupied.
Definition: EquipmentLayoutItem.cpp:66
int getSlotX() const
Gets the slotX to be occupied.
Definition: EquipmentLayoutItem.cpp:75
YAML::Node save() const
Saves the soldier-equipment layout item to YAML.
Definition: EquipmentLayoutItem.cpp:125
int getSlotY() const
Gets the slotY to be occupied.
Definition: EquipmentLayoutItem.cpp:84
std::string getAmmoItem() const
Gets the ammo item.
Definition: EquipmentLayoutItem.cpp:93
int getFuseTimer() const
Gets the turn until explosion.
Definition: EquipmentLayoutItem.cpp:102
~EquipmentLayoutItem()
Cleans up the soldier-equipment layout item.
Definition: EquipmentLayoutItem.cpp:49
std::string getItemType() const
Gets the item's type which has to be in a slot.
Definition: EquipmentLayoutItem.cpp:57
void load(const YAML::Node &node)
Loads the soldier-equipment layout item from YAML.
Definition: EquipmentLayoutItem.cpp:111