![]() |
OpenXcom
1.0
Open-source clone of the original X-Com
|
Represents a base facility placed in a base. More...
#include <BaseFacility.h>
Public Member Functions | |
| BaseFacility (RuleBaseFacility *rules, Base *base) | |
| Creates a base facility of the specified type. More... | |
| ~BaseFacility () | |
| Cleans up the base facility. | |
| void | load (const YAML::Node &node) |
| Loads the base facility from YAML. More... | |
| YAML::Node | save () const |
| Saves the base facility to YAML. More... | |
| RuleBaseFacility * | getRules () const |
| Gets the facility's ruleset. More... | |
| int | getX () const |
| Gets the facility's X position. More... | |
| void | setX (int x) |
| Sets the facility's X position. More... | |
| int | getY () const |
| Gets the facility's Y position. More... | |
| void | setY (int y) |
| Sets the facility's Y position. More... | |
| int | getBuildTime () const |
| Gets the facility's construction time. More... | |
| void | setBuildTime (int time) |
| Sets the facility's construction time. More... | |
| void | build () |
| Builds up the facility. More... | |
| bool | inUse () const |
| Checks if the facility is currently in use. More... | |
| Craft * | getCraft () const |
| Gets craft, used for drawing facility. More... | |
| void | setCraft (Craft *craft) |
| Sets craft, used for drawing facility. More... | |
Represents a base facility placed in a base.
Contains variable info about a facility like position and build time.
| OpenXcom::BaseFacility::BaseFacility | ( | RuleBaseFacility * | rules, |
| Base * | base | ||
| ) |
Creates a base facility of the specified type.
Initializes a base facility of the specified type.
| rules | Pointer to ruleset. |
| base | Pointer to base of origin. |
| void OpenXcom::BaseFacility::build | ( | ) |
Builds up the facility.
Handles the facility building every day.
| int OpenXcom::BaseFacility::getBuildTime | ( | ) | const |
Gets the facility's construction time.
Returns the base facility's remaining time until it's finished building (0 = complete).
| Craft * OpenXcom::BaseFacility::getCraft | ( | ) | const |
Gets craft, used for drawing facility.
| RuleBaseFacility * OpenXcom::BaseFacility::getRules | ( | ) | const |
Gets the facility's ruleset.
Returns the ruleset for the base facility's type.
| int OpenXcom::BaseFacility::getX | ( | ) | const |
Gets the facility's X position.
Returns the base facility's X position on the base grid that it's placed on.
| int OpenXcom::BaseFacility::getY | ( | ) | const |
Gets the facility's Y position.
Returns the base facility's Y position on the base grid that it's placed on.
| bool OpenXcom::BaseFacility::inUse | ( | ) | const |
Checks if the facility is currently in use.
Returns if this facility is currently being used by its base.
| void OpenXcom::BaseFacility::load | ( | const YAML::Node & | node | ) |
Loads the base facility from YAML.
Loads the base facility from a YAML file.
| node | YAML node. |
| YAML::Node OpenXcom::BaseFacility::save | ( | ) | const |
Saves the base facility to YAML.
Saves the base facility to a YAML file.
| void OpenXcom::BaseFacility::setBuildTime | ( | int | time | ) |
Sets the facility's construction time.
Changes the base facility's remaining time until it's finished building.
| time | Time left in days. |
| void OpenXcom::BaseFacility::setCraft | ( | Craft * | craft | ) |
Sets craft, used for drawing facility.
| craft | for drawing hangar. |
| void OpenXcom::BaseFacility::setX | ( | int | x | ) |
Sets the facility's X position.
Changes the base facility's X position on the base grid that it's placed on.
| x | X position in grid squares. |
| void OpenXcom::BaseFacility::setY | ( | int | y | ) |
Sets the facility's Y position.
Changes the base facility's Y position on the base grid that it's placed on.
| y | Y position in grid squares. |
1.8.14