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();
66 std::wstring getDefaultName(
Language *)
const {
return L
""; }
75 void load(
const YAML::Node& node,
SavedGame *
save,
bool newGame,
bool newBattleGame =
false);
77 YAML::Node
save()
const;
167 const std::vector<ResearchProject *> &
getResearch()
const;
int getAvailableQuarters() const
Gets the base's available living quarters.
Definition: Base.cpp:581
std::vector< BaseFacility * > * getFacilities()
Gets the base's facilities.
Definition: Base.cpp:314
void setupDefenses()
Setup base defenses.
Definition: Base.cpp:1344
int getAvailableStores() const
Gets the base's available storage space.
Definition: Base.cpp:647
bool getHyperDetection() const
Checks if this base is hyper-wave equipped.
Definition: Base.cpp:1130
void removeProduction(Production *p)
Remove a Base Production's.
Definition: Base.cpp:1104
int getMarker() const
Gets the base's marker.
Definition: Base.cpp:302
int getTotalScientists() const
Gets the base's total scientists.
Definition: Base.cpp:514
const std::vector< ResearchProject * > & getResearch() const
Get the list of base's ResearchProject.
Definition: Base.cpp:1063
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:1254
int getAvailablePsiLabs() const
Gets the base's total available psi lab space.
Definition: Base.cpp:1147
int getCraftMaintenance() const
Gets the base's craft maintenance.
Definition: Base.cpp:964
Represents a base facility placed in a base.
Definition: BaseFacility.h:36
int getGravShields() const
Gets how many Grav Shields the base has.
Definition: Base.cpp:1331
int getUsedLaboratories() const
Gets the base's used laboratory space.
Definition: Base.cpp:699
void destroyFacility(std::vector< BaseFacility *>::iterator facility)
destroy a facility and deal with the side effects.
Definition: Base.cpp:1555
The game data that gets written to disk when the game is saved.
Definition: SavedGame.h:99
const std::vector< Production * > & getProductions() const
Get the list of Base Production's.
Definition: Base.cpp:1118
std::vector< Vehicle * > * getVehicles()
Gets the base's vehicles.
Definition: Base.cpp:1444
int getUsedContainment() const
Gets the total amount of used Containment space.
Definition: Base.cpp:1183
Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.
Definition: Mod.h:87
YAML::Node saveId() const
Saves the base's ID to YAML.
Definition: Base.cpp:280
int getUsedPsiLabs() const
Gets the base's used psi lab space.
Definition: Base.cpp:1165
~Base()
Cleans up the base.
Definition: Base.cpp:63
int getScientists() const
Gets the base's scientists.
Definition: Base.cpp:361
int getUsedQuarters() const
Gets the base's used living quarters.
Definition: Base.cpp:571
int getSoldierCount(const std::string &soldier) const
Gets the base's soldiers of a certain type.
Definition: Base.cpp:987
int getFreeWorkshops() const
Get the number of available space lab (not used by a Production)
Definition: Base.cpp:820
ItemContainer * getStorageItems()
Gets the base's items.
Definition: Base.cpp:352
void addResearch(ResearchProject *)
Add a new ResearchProject to the Base.
Definition: Base.cpp:1081
int getPersonnelMaintenance() const
Gets the base's personnel maintenance.
Definition: Base.cpp:1012
int getAvailableHangars() const
Gets the base's available hangars.
Definition: Base.cpp:794
int getTotalEngineers() const
Gets the base's total engineers.
Definition: Base.cpp:549
int getCraftCount(const std::string &craft) const
Gets the base's crafts of a certain type.
Definition: Base.cpp:939
int detect(Target *target) const
Checks if a target is detected by the base's radar.
Definition: Base.cpp:399
Contains strings used throughout the game for localization.
Definition: Language.h:39
size_t getDetectionChance() const
Get the detection chance for this base.
Definition: Base.cpp:1317
Represent a ResearchProject Contain information about assigned scientist, time already spent and cost...
Definition: ResearchProject.h:32
int getDefenseValue() const
Gets the base's defense value.
Definition: Base.cpp:879
Definition: Production.h:31
void addProduction(Production *p)
Add a new Production to Base.
Definition: Base.cpp:1072
int getAvailableWorkshops() const
Gets the base's available workshop space.
Definition: Base.cpp:750
YAML::Node save() const
Saves the base to YAML.
Definition: Base.cpp:239
void setInBattlescape(bool inbattle)
Sets the craft's battlescape status.
Definition: Base.cpp:1245
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:388
int getAllocatedScientists() const
Returns the amount of scientists currently in use.
Definition: Base.cpp:847
std::vector< Transfer * > * getTransfers()
Gets the base's transfers.
Definition: Base.cpp:342
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:1466
std::vector< BaseFacility * > * getDefenses()
Get a list of Defensive Facilities.
Definition: Base.cpp:1434
Represents a player base on the globe.
Definition: Base.h:45
void setScientists(int scientists)
Sets the base's scientists.
Definition: Base.cpp:370
int getMonthlyMaintenace() const
Gets the base's total monthly maintenance.
Definition: Base.cpp:1054
bool storesOverfull(double offset=0.0)
Checks if the base's stores are overfull.
Definition: Base.cpp:635
int getFreeLaboratories() const
Get the number of available space lab (not used by a ResearchProject)
Definition: Base.cpp:811
int getAvailableEngineers() const
Gets the base's available engineers.
Definition: Base.cpp:539
int getEngineers() const
Gets the base's engineers.
Definition: Base.cpp:379
int getUsedWorkshops() const
Gets the base's used workshop space.
Definition: Base.cpp:735
std::wstring getName(Language *lang=0) const
Gets the base's name.
Definition: Base.cpp:293
Base(const Mod *mod)
Creates a new base.
Definition: Base.cpp:55
void cleanupDefenses(bool reclaimItems)
Cleans up the defenses vector and optionally reclaims the tanks and their ammo.
Definition: Base.cpp:1726
bool getRetaliationTarget() const
Gets the retaliation status of this base.
Definition: Base.cpp:1263
int getAvailableSoldiers(bool checkCombatReadiness=false) const
Gets the base's available soldiers.
Definition: Base.cpp:463
int getFacilityMaintenance() const
Gets the base's facility maintenance.
Definition: Base.cpp:1036
int getTotalSoldiers() const
Gets the base's total soldiers.
Definition: Base.cpp:486
int getAvailableScientists() const
Gets the base's available scientists.
Definition: Base.cpp:504
std::vector< Craft * > * getCrafts()
Gets the base's crafts.
Definition: Base.cpp:332
void destroyDisconnectedFacilities()
Destroys all disconnected facilities in the base.
Definition: Base.cpp:1452
int getAvailableContainment() const
Gets the total amount of Containment space.
Definition: Base.cpp:1219
int getAllocatedEngineers() const
Returns the amount of engineers currently in use.
Definition: Base.cpp:864
int getShortRangeDetection() const
Gets the base's short range detection.
Definition: Base.cpp:897
int getAvailableLaboratories() const
Gets the base's available laboratory space.
Definition: Base.cpp:717
virtual void load(const YAML::Node &node)
Loads the moving target from YAML.
Definition: Target.cpp:55
std::vector< Soldier * > * getSoldiers()
Gets the base's soldiers.
Definition: Base.cpp:323
Base class for targets on the globe with a set of radian coordinates.
Definition: Target.h:33
int getFreePsiLabs() const
Gets the base's total free psi lab space.
Definition: Base.cpp:829
int getFreeContainment() const
Gets the amount of free Containment space.
Definition: Base.cpp:838
int getUsedHangars() const
Gets the base's used hangars.
Definition: Base.cpp:768
double getUsedStores()
Gets the base's used storage space.
Definition: Base.cpp:599
Definition: BaseInfoState.cpp:40
int getLongRangeDetection() const
Gets the base's long range detection.
Definition: Base.cpp:918
bool isInBattlescape() const
Gets if the craft is in battlescape.
Definition: Base.cpp:1236
int insideRadarRange(Target *target) const
Checks if a target is inside the base's radar range.
Definition: Base.cpp:438
void removeResearch(ResearchProject *)
Remove a ResearchProject from the Base.
Definition: Base.cpp:1090