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