OpenXcom  1.0
Open-source clone of the original X-Com
EquipmentLayoutItem.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 <yaml-cpp/yaml.h>
22 
23 namespace OpenXcom
24 {
25 
31 {
32 private:
33  std::string _itemType;
34  std::string _slot;
35  int _slotX, _slotY;
36  std::string _ammoItem;
37  int _fuseTimer;
38 public:
40  EquipmentLayoutItem(const YAML::Node& node);
42  EquipmentLayoutItem(const std::string &itemType, const std::string &slot, int slotX, int slotY, const std::string &ammoItem, int fuseTimer);
46  std::string getItemType() const;
48  std::string getSlot() const;
50  int getSlotX() const;
52  int getSlotY() const;
54  std::string getAmmoItem() const;
56  int getFuseTimer() const;
58  void load(const YAML::Node& node);
60  YAML::Node save() const;
61 };
62 
63 }
int getSlotY() const
Gets the slotY to be occupied.
Definition: EquipmentLayoutItem.cpp:84
int getFuseTimer() const
Gets the turn until explosion.
Definition: EquipmentLayoutItem.cpp:102
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:30
YAML::Node save() const
Saves the soldier-equipment layout item to YAML.
Definition: EquipmentLayoutItem.cpp:125
std::string getAmmoItem() const
Gets the ammo item.
Definition: EquipmentLayoutItem.cpp:93
std::string getItemType() const
Gets the item&#39;s type which has to be in a slot.
Definition: EquipmentLayoutItem.cpp:57
~EquipmentLayoutItem()
Cleans up the soldier-equipment layout item.
Definition: EquipmentLayoutItem.cpp:49
std::string getSlot() const
Gets the slot to be occupied.
Definition: EquipmentLayoutItem.cpp:66
Definition: BaseInfoState.cpp:40
void load(const YAML::Node &node)
Loads the soldier-equipment layout item from YAML.
Definition: EquipmentLayoutItem.cpp:111
int getSlotX() const
Gets the slotX to be occupied.
Definition: EquipmentLayoutItem.cpp:75