mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-28 23:06:24 +02:00
62fddca21e
- 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
43 lines
932 B
C++
43 lines
932 B
C++
/*
|
|
* 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
|