OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BaseFacility.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_BASEFACILITY_H
20 #define OPENXCOM_BASEFACILITY_H
21 
22 #include <yaml-cpp/yaml.h>
23 
24 namespace OpenXcom
25 {
26 
27 class RuleBaseFacility;
28 class Base;
29 class Ruleset;
30 class Craft;
31 
39 {
40 private:
41  RuleBaseFacility *_rules;
42  Base *_base;
43  int _x, _y, _buildTime;
44  Craft *_craftForDrawing; // craft, used for drawing facility
45 public:
47  BaseFacility(RuleBaseFacility *rules, Base *base);
49  ~BaseFacility();
51  void load(const YAML::Node& node);
53  YAML::Node save() const;
55  RuleBaseFacility *getRules() const;
57  int getX() const;
59  void setX(int x);
61  int getY() const;
63  void setY(int y);
65  int getBuildTime() const;
67  void setBuildTime(int time);
69  void build();
71  bool inUse() const;
73  Craft *getCraft() const;
75  void setCraft(Craft *craft);
76 };
77 
78 }
79 
80 #endif
Represents a craft stored in a base.
Definition: Craft.h:44
YAML::Node save() const
Saves the base facility to YAML.
Definition: BaseFacility.cpp:57
int getY() const
Gets the facility's Y position.
Definition: BaseFacility.cpp:102
Represents a base facility placed in a base.
Definition: BaseFacility.h:38
bool inUse() const
Checks if the facility is currently in use.
Definition: BaseFacility.cpp:150
void load(const YAML::Node &node)
Loads the base facility from YAML.
Definition: BaseFacility.cpp:46
Craft * getCraft() const
Gets craft, used for drawing facility.
Definition: BaseFacility.cpp:169
void setCraft(Craft *craft)
Sets craft, used for drawing facility.
Definition: BaseFacility.cpp:178
void setY(int y)
Sets the facility's Y position.
Definition: BaseFacility.cpp:112
void setBuildTime(int time)
Sets the facility's construction time.
Definition: BaseFacility.cpp:132
Represents a player base on the globe.
Definition: Base.h:47
RuleBaseFacility * getRules() const
Gets the facility's ruleset.
Definition: BaseFacility.cpp:72
int getX() const
Gets the facility's X position.
Definition: BaseFacility.cpp:82
void build()
Builds up the facility.
Definition: BaseFacility.cpp:140
BaseFacility(RuleBaseFacility *rules, Base *base)
Creates a base facility of the specified type.
Definition: BaseFacility.cpp:31
int getBuildTime() const
Gets the facility's construction time.
Definition: BaseFacility.cpp:122
void setX(int x)
Sets the facility's X position.
Definition: BaseFacility.cpp:92
~BaseFacility()
Cleans up the base facility.
Definition: BaseFacility.cpp:38
Represents a specific type of base facility.
Definition: RuleBaseFacility.h:35