OpenXcom  1.0
Open-source clone of the original X-Com
RuleInterface.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 <map>
22 #include <yaml-cpp/yaml.h>
23 
24 namespace OpenXcom
25 {
26 
27 struct Element
28 {
30  int x, y, w, h, color, color2, border;
32  bool TFTDMode;
33 };
34 
36 {
37 private:
38  std::string _type;
39  std::string _palette;
40  std::string _parent;
41  std::string _music;
42 
43  std::map <std::string, Element> _elements;
44 public:
46  RuleInterface(const std::string & type);
50  void load(const YAML::Node& node);
52  Element *getElement(const std::string &id);
54  const std::string &getPalette() const;
56  const std::string &getParent() const;
58  const std::string &getMusic() const;
59 };
60 
61 }
bool TFTDMode
defines inversion behaviour
Definition: RuleInterface.h:32
Definition: RuleInterface.h:35
Definition: RuleInterface.h:27
void load(const YAML::Node &node)
Load from YAML.
Definition: RuleInterface.cpp:43
~RuleInterface()
Destructor.
Definition: RuleInterface.cpp:35
const std::string & getMusic() const
Get music.
Definition: RuleInterface.cpp:101
const std::string & getPalette() const
Get palette.
Definition: RuleInterface.cpp:91
const std::string & getParent() const
Get parent interface rule.
Definition: RuleInterface.cpp:96
int x
basic rect info, and 3 colors.
Definition: RuleInterface.h:30
RuleInterface(const std::string &type)
Constructor.
Definition: RuleInterface.cpp:31
Element * getElement(const std::string &id)
Get an element.
Definition: RuleInterface.cpp:85
Definition: BaseInfoState.cpp:40