1 // _________ __ __ 2 // / _____// |_____________ _/ |______ ____ __ __ ______ 3 // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ 4 // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ | 5 // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > 6 // \/ \/ \//_____/ \/ 7 // ______________________ ______________________ 8 // T H E W A R B E G I N S 9 // Stratagus - A free fantasy real time strategy game engine 10 // 11 /**@name civilization.h - The civilization header file. */ 12 // 13 // (c) Copyright 2018-2019 by Andrettin 14 // 15 // This program is free software; you can redistribute it and/or modify 16 // it under the terms of the GNU General Public License as published by 17 // the Free Software Foundation; only version 2 of the License. 18 // 19 // This program is distributed in the hope that it will be useful, 20 // but WITHOUT ANY WARRANTY; without even the implied warranty of 21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 // GNU General Public License for more details. 23 // 24 // You should have received a copy of the GNU General Public License 25 // along with this program; if not, write to the Free Software 26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 27 // 02111-1307, USA. 28 // 29 30 #ifndef __CIVILIZATION_H__ 31 #define __CIVILIZATION_H__ 32 33 //@{ 34 35 /*---------------------------------------------------------------------------- 36 -- Includes 37 ----------------------------------------------------------------------------*/ 38 39 #include <map> 40 #include <string> 41 #include <vector> 42 43 #include "player.h" //for certain enums 44 #include "time/date.h" 45 46 /*---------------------------------------------------------------------------- 47 -- Declarations 48 ----------------------------------------------------------------------------*/ 49 50 class CAiBuildingTemplate; 51 class CCalendar; 52 class CCurrency; 53 class CDeity; 54 class CForceTemplate; 55 class CLanguage; 56 class CQuest; 57 class CUpgrade; 58 59 class CCivilization 60 { 61 public: 62 ~CCivilization(); 63 64 static CCivilization *GetCivilization(const std::string &ident, const bool should_find = true); 65 static CCivilization *GetOrAddCivilization(const std::string &ident); 66 static void ClearCivilizations(); 67 68 static std::vector<CCivilization *> Civilizations; /// civilizations 69 static std::map<std::string, CCivilization *> CivilizationsByIdent; 70 71 int GetUpgradePriority(const CUpgrade *upgrade) const; 72 int GetForceTypeWeight(int force_type) const; 73 CCalendar *GetCalendar() const; 74 CCurrency *GetCurrency() const; 75 std::vector<CForceTemplate *> GetForceTemplates(int force_type) const; 76 std::vector<CAiBuildingTemplate *> GetAiBuildingTemplates() const; 77 std::map<int, std::vector<std::string>> &GetPersonalNames(); 78 std::vector<std::string> &GetUnitClassNames(int class_id); 79 std::vector<std::string> &GetShipNames(); 80 81 int ID = -1; 82 CCivilization *ParentCivilization = nullptr; 83 std::string Ident; /// ident of the civilization 84 std::string Description; /// civilization description 85 std::string Quote; /// civilization quote 86 std::string Background; /// civilization background 87 std::string Adjective; /// adjective pertaining to the civilization 88 CUnitSound UnitSounds; /// sounds for unit events 89 CLanguage *Language = nullptr; /// the language used by the civilization 90 CCalendar *Calendar = nullptr; /// the calendar used by the civilization 91 CCurrency *Currency = nullptr; /// the currency used by the civilization 92 std::vector<CQuest *> Quests; /// quests belonging to this civilization 93 std::map<const CUpgrade *, int> UpgradePriorities; /// Priority for each upgrade 94 std::map<int, std::vector<CForceTemplate *>> ForceTemplates; /// Force templates, mapped to each force type 95 std::map<int, int> ForceTypeWeights; /// Weights for each force type 96 std::vector<CAiBuildingTemplate *> AiBuildingTemplates; /// AI building templates 97 std::map<int, std::vector<std::string>> PersonalNames; /// Personal names for the civilization, mapped to the gender they pertain to (use NoGender for names which should be available for both genders) 98 std::map<int, std::vector<std::string>> UnitClassNames; /// Unit class names for the civilization, mapped to the unit class they pertain to, used for mechanical units, and buildings 99 std::vector<std::string> FamilyNames; /// Family names for the civilization 100 std::vector<std::string> ProvinceNames; /// Province names for the civilization 101 std::vector<std::string> ShipNames; /// Ship names for the civilization 102 std::vector<CDeity *> Deities; 103 std::vector<CSite *> Sites; /// Sites used for this civilization if a randomly-generated one is required 104 std::string MinisterTitles[MaxCharacterTitles][MaxGenders][MaxGovernmentTypes][MaxFactionTiers]; /// this civilization's minister title for each minister type and government type 105 std::map<std::string, std::map<CDate, bool>> HistoricalUpgrades; /// historical upgrades of the faction, with the date of change 106 }; 107 108 //@} 109 110 #endif // !__CIVILIZATION_H__ 111