/* * GameLibrary.h, part of VCMI engine * * Authors: listed in file AUTHORS in main folder * * License: GNU General Public License v2.0 or later * Full text of license available in license.txt file, in main folder * */ #pragma once #include VCMI_LIB_NAMESPACE_BEGIN class CConsoleHandler; class CArtHandler; class CHeroHandler; class CHeroClassHandler; class CCreatureHandler; class CSpellHandler; class CSkillHandler; class CObjectHandler; class CObjectClassesHandler; class ObstacleSetHandler; class CTownHandler; class CGeneralTextHandler; class CModHandler; class CContentHandler; class BattleFieldHandler; class IBonusTypeHandler; class CBonusTypeHandler; class TerrainTypeHandler; class RoadTypeHandler; class RiverTypeHandler; class ObstacleHandler; class CTerrainViewPatternConfig; class CRmgTemplateStorage; class IHandlerBase; class IGameSettings; class GameSettings; class CIdentifierStorage; #if SCRIPTING_ENABLED namespace scripting { class ScriptHandler; } #endif /// Loads and constructs several handlers class DLL_LINKAGE GameLibrary final : public Services { public: const ArtifactService * artifacts() const override; const CreatureService * creatures() const override; const FactionService * factions() const override; const HeroClassService * heroClasses() const override; const HeroTypeService * heroTypes() const override; #if SCRIPTING_ENABLED const scripting::Service * scripts() const override; #endif const spells::Service * spells() const override; const SkillService * skills() const override; const BattleFieldService * battlefields() const override; const ObstacleService * obstacles() const override; const IGameSettings * engineSettings() const override; const spells::effects::Registry * spellEffects() const override; spells::effects::Registry * spellEffects() override; const IBonusTypeHandler * getBth() const; //deprecated const CIdentifierStorage * identifiers() const; std::unique_ptr arth; std::unique_ptr bth; std::unique_ptr heroh; std::unique_ptr heroclassesh; std::unique_ptr creh; std::unique_ptr spellh; std::unique_ptr skillh; // TODO: Remove ObjectHandler altogether? std::unique_ptr objh; std::unique_ptr objtypeh; std::unique_ptr townh; std::unique_ptr generaltexth; std::unique_ptr modh; std::unique_ptr terrainTypeHandler; std::unique_ptr roadTypeHandler; std::unique_ptr riverTypeHandler; std::unique_ptr identifiersHandler; std::unique_ptr terviewh; std::unique_ptr tplh; std::unique_ptr battlefieldsHandler; std::unique_ptr obstacleHandler; std::unique_ptr settingsHandler; std::unique_ptr biomeHandler; #if SCRIPTING_ENABLED std::unique_ptr scriptHandler; #endif GameLibrary(); ~GameLibrary(); /// initializes settings and filesystem void initializeFilesystem(bool extractArchives); /// Loads all game entities void initializeLibrary(); private: // basic initialization. should be called before init(). Can also extract original H3 archives void loadFilesystem(bool extractArchives); void loadModFilesystem(); #if SCRIPTING_ENABLED void scriptsLoaded(); #endif }; extern DLL_LINKAGE GameLibrary * LIBRARY; VCMI_LIB_NAMESPACE_END