19 #ifndef OPENXCOM_BASE_H
20 #define OPENXCOM_BASE_H
25 #include <yaml-cpp/yaml.h>
39 class ResearchProject;
50 static const int BASE_SIZE = 6;
53 std::vector<BaseFacility*> _facilities;
54 std::vector<Soldier*> _soldiers;
55 std::vector<Craft*> _crafts;
56 std::vector<Transfer*> _transfers;
58 int _scientists, _engineers;
59 std::vector<ResearchProject *> _research;
60 std::vector<Production *> _productions;
62 bool _retaliationTarget;
63 std::vector<Vehicle*> _vehicles;
64 std::vector<BaseFacility*> _defenses;
66 double getIgnoredStores();
73 void load(
const YAML::Node& node,
SavedGame *
save,
bool newGame,
bool newBattleGame =
false);
75 YAML::Node
save()
const;
81 void setName(
const std::wstring &name);
163 const std::vector<ResearchProject *> &
getResearch()
const;
std::vector< BaseFacility * > * getFacilities()
Gets the base's facilities.
Definition: Base.cpp:284
void setupDefenses()
Setup base defenses.
Definition: Base.cpp:1237
void removeProduction(Production *p)
Remove a Base Production's.
Definition: Base.cpp:1002
int getLongRangeDetection() const
Gets the base's long range detection.
Definition: Base.cpp:868
const std::vector< ResearchProject * > & getResearch() const
Get the list of base's ResearchProject.
Definition: Base.cpp:961
void load(const YAML::Node &node, SavedGame *save, bool newGame, bool newBattleGame=false)
Loads the base from YAML.
Definition: Base.cpp:105
void setRetaliationTarget(bool mark=true)
Mark this base for alien retaliation.
Definition: Base.cpp:1155
int getTotalSoldiers() const
Gets the base's total soldiers.
Definition: Base.cpp:448
int getAvailableWorkshops() const
Gets the base's available workshop space.
Definition: Base.cpp:712
Represents a base facility placed in a base.
Definition: BaseFacility.h:38
int getUsedWorkshops() const
Gets the base's used workshop space.
Definition: Base.cpp:697
void setName(const std::wstring &name)
Sets the base's name.
Definition: Base.cpp:275
ItemContainer * getItems()
Gets the base's items.
Definition: Base.cpp:321
The game data that gets written to disk when the game is saved.
Definition: SavedGame.h:80
int getUsedLaboratories() const
Gets the base's used laboratory space.
Definition: Base.cpp:661
int getFacilityMaintenance() const
Gets the base's facility maintenance.
Definition: Base.cpp:934
int getAvailableLaboratories() const
Gets the base's available laboratory space.
Definition: Base.cpp:679
std::vector< Vehicle * > * getVehicles()
Gets the base's vehicles.
Definition: Base.cpp:1315
~Base()
Cleans up the base.
Definition: Base.cpp:62
int getUsedQuarters() const
Gets the base's used living quarters.
Definition: Base.cpp:533
int getAvailableHangars() const
Gets the base's available hangars.
Definition: Base.cpp:756
int getAvailableStores() const
Gets the base's available storage space.
Definition: Base.cpp:609
int getScientists() const
Gets the base's scientists.
Definition: Base.cpp:330
int getFreeLaboratories() const
Get the number of available space lab (not used by a ResearchProject)
Definition: Base.cpp:773
void addResearch(ResearchProject *)
Add a new ResearchProject to the Base.
Definition: Base.cpp:979
int getAvailableScientists() const
Gets the base's available scientists.
Definition: Base.cpp:466
bool isInBattlescape() const
Gets if the craft is in battlescape.
Definition: Base.cpp:1137
int getEngineers() const
Gets the base's engineers.
Definition: Base.cpp:348
int getUsedContainment() const
Gets the total amount of used Containment Space.
Definition: Base.cpp:1081
bool getRetaliationTarget() const
Gets the retaliation status of this base.
Definition: Base.cpp:1164
const std::vector< Production * > & getProductions() const
Get the list of Base Production's.
Definition: Base.cpp:1016
Contains strings used throughout the game for localization.
Definition: Language.h:42
Represent a ResearchProject Contain information about assigned scientist, time already spent and cost...
Definition: ResearchProject.h:33
Set of rules and stats for a game.
Definition: Ruleset.h:69
int getFreeWorkshops() const
Get the number of available space lab (not used by a Production)
Definition: Base.cpp:782
int getFreePsiLabs() const
Gets the base's total free psi lab space.
Definition: Base.cpp:791
Definition: Production.h:31
int getAvailableQuarters() const
Gets the base's available living quarters.
Definition: Base.cpp:543
void addProduction(Production *p)
Add a new Production to Base.
Definition: Base.cpp:970
int getTotalEngineers() const
Gets the base's total engineers.
Definition: Base.cpp:511
int getCraftCount(const std::string &craft) const
Gets the base's crafts of a certain type.
Definition: Base.cpp:887
void setInBattlescape(bool inbattle)
Sets the craft's battlescape status.
Definition: Base.cpp:1146
Represents the items contained by a certain entity, like base stores, craft equipment, etc.
Definition: ItemContainer.h:36
void setEngineers(int engineers)
Sets the base's engineers.
Definition: Base.cpp:357
std::vector< Transfer * > * getTransfers()
Gets the base's transfers.
Definition: Base.cpp:312
std::list< std::vector< BaseFacility * >::iterator > getDisconnectedFacilities(BaseFacility *remove)
Gets a sorted list of the facilities(=iterators) NOT connected to the Access Lift.
Definition: Base.cpp:1337
int getPersonnelMaintenance() const
Gets the base's personnel maintenance.
Definition: Base.cpp:920
YAML::Node saveId() const
Saves the base's ID to YAML.
Definition: Base.cpp:253
std::wstring getName(Language *lang=0) const
Gets the base's name.
Definition: Base.cpp:266
std::vector< BaseFacility * > * getDefenses()
Get a list of Defensive Facilities.
Definition: Base.cpp:1305
Represents a player base on the globe.
Definition: Base.h:47
void setScientists(int scientists)
Sets the base's scientists.
Definition: Base.cpp:339
bool storesOverfull(double offset=0.0)
Checks if the base's stores are overfull.
Definition: Base.cpp:597
int getMonthlyMaintenace() const
Gets the base's total monthly maintenance.
Definition: Base.cpp:952
void destroyFacility(std::vector< BaseFacility * >::iterator facility)
destroy a facility and deal with the side effects.
Definition: Base.cpp:1426
int getShortRangeDetection() const
Gets the base's short range detection.
Definition: Base.cpp:850
YAML::Node save() const
Saves the base to YAML.
Definition: Base.cpp:213
int getTotalScientists() const
Gets the base's total scientists.
Definition: Base.cpp:476
int getGravShields() const
Gets how many Grav Shields the base has.
Definition: Base.cpp:1224
int getDefenseValue() const
Gets the base's defense value.
Definition: Base.cpp:832
std::vector< Craft * > * getCrafts()
Gets the base's crafts.
Definition: Base.cpp:302
void destroyDisconnectedFacilities()
Destroys all disconnected facilities in the base.
Definition: Base.cpp:1323
int getAvailableContainment() const
Gets the total amount of Containment Space.
Definition: Base.cpp:1120
int getAllocatedEngineers() const
Returns the amount of engineers currently in use.
Definition: Base.cpp:817
std::vector< Soldier * > * getSoldiers()
Gets the base's soldiers.
Definition: Base.cpp:293
int getAvailablePsiLabs() const
Gets the base's total available psi lab space.
Definition: Base.cpp:1045
Base class for targets on the globe with a set of radian coordinates.
Definition: Target.h:35
Base(const Ruleset *rule)
Creates a new base.
Definition: Base.cpp:54
int detect(Target *target) const
Checks if a target is detected by the base's radar.
Definition: Base.cpp:368
int insideRadarRange(Target *target) const
Checks if a target is inside the base's radar range.
Definition: Base.cpp:400
int getCraftMaintenance() const
Gets the base's craft maintenance.
Definition: Base.cpp:905
int getUsedPsiLabs() const
Gets the base's used psi lab space.
Definition: Base.cpp:1063
int getAllocatedScientists() const
Returns the amount of scientists currently in use.
Definition: Base.cpp:800
double getUsedStores()
Gets the base's used storage space.
Definition: Base.cpp:561
int getAvailableEngineers() const
Gets the base's available engineers.
Definition: Base.cpp:501
int getAvailableSoldiers(bool checkCombatReadiness=false) const
Gets the base's available soldiers.
Definition: Base.cpp:425
size_t getDetectionChance(int difficulty) const
Get the detection chance for this base.
Definition: Base.cpp:1217
bool getHyperDetection() const
Checks if this base is hyper-wave equipped.
Definition: Base.cpp:1028
void removeResearch(ResearchProject *)
Remove a ResearchProject from the Base.
Definition: Base.cpp:988
int getUsedHangars() const
Gets the base's used hangars.
Definition: Base.cpp:730