mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Split massive CModHandler class/file into multiple parts:
- IdentifierStorage is now a separate handler in VLC - Renamed ModHandler::Incompatibility exception to ModIncompatibility - Extracted ModScope namespace from ModHandler - Extracted ModUtilities namespace from ModHandler - Split CModHandler.cpp on per-class basis - Replaced some direct members with unique_ptr to reduce header includes
This commit is contained in:
42
lib/modding/ModIncompatibility.h
Normal file
42
lib/modding/ModIncompatibility.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* ModIncompatibility.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
|
||||
|
||||
class DLL_LINKAGE ModIncompatibility: public std::exception
|
||||
{
|
||||
public:
|
||||
using StringPair = std::pair<const std::string, const std::string>;
|
||||
using ModList = std::list<StringPair>;
|
||||
|
||||
ModIncompatibility(ModList && _missingMods):
|
||||
missingMods(std::move(_missingMods))
|
||||
{
|
||||
std::ostringstream _ss;
|
||||
for(const auto & m : missingMods)
|
||||
_ss << m.first << ' ' << m.second << std::endl;
|
||||
message = _ss.str();
|
||||
}
|
||||
|
||||
const char * what() const noexcept override
|
||||
{
|
||||
return message.c_str();
|
||||
}
|
||||
|
||||
private:
|
||||
//list of mods required to load the game
|
||||
// first: mod name
|
||||
// second: mod version
|
||||
const ModList missingMods;
|
||||
std::string message;
|
||||
};
|
||||
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
Reference in New Issue
Block a user