23 #include <yaml-cpp/yaml.h> 37 class ResearchProject;
48 static const int BASE_SIZE = 6;
50 std::vector<BaseFacility*> _facilities;
51 std::vector<Soldier*> _soldiers;
52 std::vector<Craft*> _crafts;
53 std::vector<Transfer*> _transfers;
55 int _scientists, _engineers;
56 std::vector<ResearchProject *> _research;
57 std::vector<Production *> _productions;
59 bool _retaliationTarget;
60 std::vector<Vehicle*> _vehicles;
61 std::vector<BaseFacility*> _defenses;
64 double getIgnoredStores();
73 void load(
const YAML::Node& node,
SavedGame *
save,
bool newGame,
bool newBattleGame =
false);
75 YAML::Node
save()
const;
165 const std::vector<ResearchProject *> &
getResearch()
const;
std::vector< BaseFacility * > * getFacilities()
Gets the base's facilities.
Definition: Base.cpp:312
void setupDefenses()
Setup base defenses.
Definition: Base.cpp:1353
int getMarker() const
Gets the base's marker sprite.
Definition: Base.cpp:300
void removeProduction(Production *p)
Remove a Base Production's.
Definition: Base.cpp:1112
int getLongRangeDetection() const
Gets the base's long range detection.
Definition: Base.cpp:916
const std::vector< ResearchProject * > & getResearch() const
Get the list of base's ResearchProject.
Definition: Base.cpp:1061
void load(const YAML::Node &node, SavedGame *save, bool newGame, bool newBattleGame=false)
Loads the base from YAML.
Definition: Base.cpp:106
void setRetaliationTarget(bool mark=true)
Mark this base for alien retaliation.
Definition: Base.cpp:1263
int getTotalSoldiers() const
Gets the base's total soldiers.
Definition: Base.cpp:484
int getAvailableWorkshops() const
Gets the base's available workshop space.
Definition: Base.cpp:748
Represents a base facility placed in a base.
Definition: BaseFacility.h:36
int getUsedWorkshops() const
Gets the base's used workshop space.
Definition: Base.cpp:733
The game data that gets written to disk when the game is saved.
Definition: SavedGame.h:99
int getUsedLaboratories() const
Gets the base's used laboratory space.
Definition: Base.cpp:697
int getFacilityMaintenance() const
Gets the base's facility maintenance.
Definition: Base.cpp:1034
int getAvailableLaboratories() const
Gets the base's available laboratory space.
Definition: Base.cpp:715
std::vector< Vehicle * > * getVehicles()
Gets the base's vehicles.
Definition: Base.cpp:1453
Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.
Definition: Mod.h:87
int getFreeContainment() const
Gets the amount of free Containment space.
Definition: Base.cpp:836
size_t getDetectionChance() const
Get the detection chance for this base.
Definition: Base.cpp:1326
~Base()
Cleans up the base.
Definition: Base.cpp:63
int getUsedQuarters() const
Gets the base's used living quarters.
Definition: Base.cpp:569
int getAvailableHangars() const
Gets the base's available hangars.
Definition: Base.cpp:792
int getAvailableStores() const
Gets the base's available storage space.
Definition: Base.cpp:645
std::string getType() const
Gets the base's type.
Definition: Base.cpp:281
ItemContainer * getStorageItems()
Gets the base's items.
Definition: Base.cpp:350
int getScientists() const
Gets the base's scientists.
Definition: Base.cpp:359
int getFreeLaboratories() const
Get the number of available space lab (not used by a ResearchProject)
Definition: Base.cpp:809
void addResearch(ResearchProject *)
Add a new ResearchProject to the Base.
Definition: Base.cpp:1079
int getAvailableScientists() const
Gets the base's available scientists.
Definition: Base.cpp:502
bool isInBattlescape() const
Gets if the craft is in battlescape.
Definition: Base.cpp:1245
int getEngineers() const
Gets the base's engineers.
Definition: Base.cpp:377
int getUsedContainment() const
Gets the total amount of used Containment space.
Definition: Base.cpp:1192
bool getRetaliationTarget() const
Gets the retaliation status of this base.
Definition: Base.cpp:1272
const std::vector< Production * > & getProductions() const
Get the list of Base Production's.
Definition: Base.cpp:1127
Contains strings used throughout the game for localization.
Definition: Language.h:39
Represent a ResearchProject Contain information about assigned scientist, time already spent and cost...
Definition: ResearchProject.h:32
int getFreeWorkshops() const
Get the number of available space lab (not used by a Production)
Definition: Base.cpp:818
int getFreePsiLabs() const
Gets the base's total free psi lab space.
Definition: Base.cpp:827
Definition: Production.h:31
int getAvailableQuarters() const
Gets the base's available living quarters.
Definition: Base.cpp:579
void addProduction(Production *p)
Add a new Production to Base.
Definition: Base.cpp:1070
int getTotalEngineers() const
Gets the base's total engineers.
Definition: Base.cpp:547
int getCraftCount(const std::string &craft) const
Gets the base's crafts of a certain type.
Definition: Base.cpp:937
void setInBattlescape(bool inbattle)
Sets the craft's battlescape status.
Definition: Base.cpp:1254
Represents the items contained by a certain entity, like base stores, craft equipment, etc.
Definition: ItemContainer.h:34
void setEngineers(int engineers)
Sets the base's engineers.
Definition: Base.cpp:386
std::vector< Transfer * > * getTransfers()
Gets the base's transfers.
Definition: Base.cpp:340
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:1475
int getPersonnelMaintenance() const
Gets the base's personnel maintenance.
Definition: Base.cpp:1010
std::vector< BaseFacility * > * getDefenses()
Get a list of Defensive Facilities.
Definition: Base.cpp:1443
Represents a player base on the globe.
Definition: Base.h:45
void setScientists(int scientists)
Sets the base's scientists.
Definition: Base.cpp:368
std::string getName(Language *lang=0) const
Gets the base's name.
Definition: Base.cpp:291
bool storesOverfull(double offset=0.0)
Checks if the base's stores are overfull.
Definition: Base.cpp:633
int getMonthlyMaintenace() const
Gets the base's total monthly maintenance.
Definition: Base.cpp:1052
void destroyFacility(std::vector< BaseFacility * >::iterator facility)
destroy a facility and deal with the side effects.
Definition: Base.cpp:1564
Base(const Mod *mod)
Creates a new base.
Definition: Base.cpp:55
int getShortRangeDetection() const
Gets the base's short range detection.
Definition: Base.cpp:895
void cleanupDefenses(bool reclaimItems)
Cleans up the defenses vector and optionally reclaims the tanks and their ammo.
Definition: Base.cpp:1735
YAML::Node save() const
Saves the base to YAML.
Definition: Base.cpp:239
int getTotalScientists() const
Gets the base's total scientists.
Definition: Base.cpp:512
int getGravShields() const
Gets how many Grav Shields the base has.
Definition: Base.cpp:1340
int getDefenseValue() const
Gets the base's defense value.
Definition: Base.cpp:877
int getSoldierCount(const std::string &soldier) const
Gets the base's soldiers of a certain type.
Definition: Base.cpp:985
std::vector< Craft * > * getCrafts()
Gets the base's crafts.
Definition: Base.cpp:330
void destroyDisconnectedFacilities()
Destroys all disconnected facilities in the base.
Definition: Base.cpp:1461
int getAvailableContainment() const
Gets the total amount of Containment space.
Definition: Base.cpp:1228
int getAllocatedEngineers() const
Returns the amount of engineers currently in use.
Definition: Base.cpp:862
virtual void load(const YAML::Node &node)
Loads the target from YAML.
Definition: Target.cpp:51
std::vector< Soldier * > * getSoldiers()
Gets the base's soldiers.
Definition: Base.cpp:321
int getAvailablePsiLabs() const
Gets the base's total available psi lab space.
Definition: Base.cpp:1156
Base class for targets on the globe with a set of radian coordinates.
Definition: Target.h:35
int detect(Target *target) const
Checks if a target is detected by the base's radar.
Definition: Base.cpp:397
int insideRadarRange(Target *target) const
Checks if a target is inside the base's radar range.
Definition: Base.cpp:436
int getCraftMaintenance() const
Gets the base's craft maintenance.
Definition: Base.cpp:962
int getUsedPsiLabs() const
Gets the base's used psi lab space.
Definition: Base.cpp:1174
int getAllocatedScientists() const
Returns the amount of scientists currently in use.
Definition: Base.cpp:845
double getUsedStores()
Gets the base's used storage space.
Definition: Base.cpp:597
int getAvailableEngineers() const
Gets the base's available engineers.
Definition: Base.cpp:537
int getAvailableSoldiers(bool checkCombatReadiness=false) const
Gets the base's available soldiers.
Definition: Base.cpp:461
bool getHyperDetection() const
Checks if this base is hyper-wave equipped.
Definition: Base.cpp:1139
Definition: BaseInfoState.cpp:40
void removeResearch(ResearchProject *)
Remove a ResearchProject from the Base.
Definition: Base.cpp:1088
int getUsedHangars() const
Gets the base's used hangars.
Definition: Base.cpp:766