2024-11-09 22:29:07 +02:00
|
|
|
/*
|
|
|
|
* ModDescription.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
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
struct CModVersion;
|
|
|
|
struct ModVerificationInfo;
|
|
|
|
class JsonNode;
|
|
|
|
|
|
|
|
using TModID = std::string;
|
|
|
|
using TModList = std::vector<TModID>;
|
|
|
|
using TModSet = std::set<TModID>;
|
|
|
|
|
|
|
|
class DLL_LINKAGE ModDescription : boost::noncopyable
|
|
|
|
{
|
2024-11-14 17:41:22 +02:00
|
|
|
TModID identifier;
|
|
|
|
|
2024-11-13 19:25:59 +02:00
|
|
|
std::unique_ptr<JsonNode> localConfig;
|
|
|
|
std::unique_ptr<JsonNode> repositoryConfig;
|
|
|
|
|
2024-11-09 22:29:07 +02:00
|
|
|
TModSet dependencies;
|
|
|
|
TModSet softDependencies;
|
|
|
|
TModSet conflicts;
|
|
|
|
|
|
|
|
TModSet loadModList(const JsonNode & configNode) const;
|
|
|
|
|
|
|
|
public:
|
2024-11-12 22:00:21 +02:00
|
|
|
ModDescription(const TModID & fullID, const JsonNode & localConfig, const JsonNode & repositoryConfig);
|
2024-11-09 22:29:07 +02:00
|
|
|
~ModDescription();
|
|
|
|
|
|
|
|
const TModID & getID() const;
|
|
|
|
TModID getParentID() const;
|
2024-11-15 13:54:43 +02:00
|
|
|
TModID getTopParentID() const;
|
2024-11-09 22:29:07 +02:00
|
|
|
|
|
|
|
const TModSet & getDependencies() const;
|
|
|
|
const TModSet & getSoftDependencies() const;
|
|
|
|
const TModSet & getConflicts() const;
|
|
|
|
|
|
|
|
const std::string & getBaseLanguage() const;
|
|
|
|
const std::string & getName() const;
|
|
|
|
|
|
|
|
const JsonNode & getFilesystemConfig() const;
|
2024-11-12 22:00:21 +02:00
|
|
|
const JsonNode & getLocalConfig() const;
|
|
|
|
const JsonNode & getValue(const std::string & keyName) const;
|
2024-11-15 13:54:43 +02:00
|
|
|
const JsonNode & getLocalizedValue(const std::string & keyName) const;
|
2024-11-12 22:00:21 +02:00
|
|
|
const JsonNode & getLocalValue(const std::string & keyName) const;
|
|
|
|
const JsonNode & getRepositoryValue(const std::string & keyName) const;
|
2024-11-09 22:29:07 +02:00
|
|
|
|
|
|
|
CModVersion getVersion() const;
|
|
|
|
ModVerificationInfo getVerificationInfo() const;
|
|
|
|
|
2024-11-14 20:01:49 +02:00
|
|
|
bool isCompatible() const;
|
|
|
|
|
2024-11-09 22:29:07 +02:00
|
|
|
bool affectsGameplay() const;
|
2024-11-11 13:19:14 +02:00
|
|
|
bool isCompatibility() const;
|
|
|
|
bool isTranslation() const;
|
|
|
|
bool keepDisabled() const;
|
2024-11-12 22:00:21 +02:00
|
|
|
bool isInstalled() const;
|
2024-11-09 22:29:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|