OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
OpenXcom::BaseFacility Class Reference

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...
 
RuleBaseFacilitygetRules () 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...
 
CraftgetCraft () const
 Gets craft, used for drawing facility. More...
 
void setCraft (Craft *craft)
 Sets craft, used for drawing facility. More...
 

Detailed Description

Represents a base facility placed in a base.

Contains variable info about a facility like position and build time.

See also
RuleBaseFacility

Constructor & Destructor Documentation

OpenXcom::BaseFacility::BaseFacility ( RuleBaseFacility rules,
Base base 
)

Creates a base facility of the specified type.

Initializes a base facility of the specified type.

Parameters
rulesPointer to ruleset.
basePointer to base of origin.

Member Function Documentation

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).

Returns
Time left in days.
Craft * OpenXcom::BaseFacility::getCraft ( ) const

Gets craft, used for drawing facility.

Returns
craft
RuleBaseFacility * OpenXcom::BaseFacility::getRules ( ) const

Gets the facility's ruleset.

Returns the ruleset for the base facility's type.

Returns
Pointer to ruleset.
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.

Returns
X position in grid squares.
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.

Returns
Y position in grid squares.
bool OpenXcom::BaseFacility::inUse ( ) const

Checks if the facility is currently in use.

Returns if this facility is currently being used by its base.

Returns
True if it's under use, False otherwise.
void OpenXcom::BaseFacility::load ( const YAML::Node &  node)

Loads the base facility from YAML.

Loads the base facility from a YAML file.

Parameters
nodeYAML node.
YAML::Node OpenXcom::BaseFacility::save ( ) const

Saves the base facility to YAML.

Saves the base facility to a YAML file.

Returns
YAML node.
void OpenXcom::BaseFacility::setBuildTime ( int  time)

Sets the facility's construction time.

Changes the base facility's remaining time until it's finished building.

Parameters
timeTime left in days.
void OpenXcom::BaseFacility::setCraft ( Craft craft)

Sets craft, used for drawing facility.

Parameters
craftfor 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.

Parameters
xX 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.

Parameters
yY position in grid squares.

The documentation for this class was generated from the following files: