mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-07 07:10:04 +02:00
Formatting
This commit is contained in:
parent
3af255d1b9
commit
f5b348a1d1
@ -17,18 +17,19 @@
|
||||
#include "../CModHandler.h"
|
||||
#include "../VCMI_Lib.h"
|
||||
|
||||
namespace TriggeredEventsDetail{
|
||||
|
||||
static const std::array<std::string, 12> conditionNames = {
|
||||
"haveArtifact", "haveCreatures", "haveResources", "haveBuilding",
|
||||
"control", "destroy", "transport", "daysPassed",
|
||||
"isHuman", "daysWithoutTown", "standardWin", "constValue"
|
||||
};
|
||||
|
||||
static const std::array<std::string, 2> typeNames = { "victory", "defeat" };
|
||||
|
||||
static EventCondition JsonToCondition(const JsonNode & node)
|
||||
namespace TriggeredEventsDetail
|
||||
{
|
||||
static const std::array<std::string, 12> conditionNames =
|
||||
{
|
||||
"haveArtifact", "haveCreatures", "haveResources", "haveBuilding",
|
||||
"control", "destroy", "transport", "daysPassed",
|
||||
"isHuman", "daysWithoutTown", "standardWin", "constValue"
|
||||
};
|
||||
|
||||
static const std::array<std::string, 2> typeNames = { "victory", "defeat" };
|
||||
|
||||
static EventCondition JsonToCondition(const JsonNode & node)
|
||||
{
|
||||
EventCondition event;
|
||||
event.condition = EventCondition::EWinLoseType(vstd::find_pos(conditionNames, node.Vector()[0].String()));
|
||||
if (node.Vector().size() > 1)
|
||||
@ -51,10 +52,10 @@ static EventCondition JsonToCondition(const JsonNode & node)
|
||||
}
|
||||
}
|
||||
return event;
|
||||
}
|
||||
}
|
||||
|
||||
static JsonNode ConditionToJson(const EventCondition& event)
|
||||
{
|
||||
static JsonNode ConditionToJson(const EventCondition& event)
|
||||
{
|
||||
JsonNode json;
|
||||
|
||||
JsonVector& asVector = json.Vector();
|
||||
@ -82,11 +83,11 @@ static JsonNode ConditionToJson(const EventCondition& event)
|
||||
asVector.push_back(data);
|
||||
|
||||
return std::move(json);
|
||||
}
|
||||
|
||||
}
|
||||
}//namespace TriggeredEventsDetail
|
||||
|
||||
namespace TerrainDetail{
|
||||
namespace TerrainDetail
|
||||
{
|
||||
static const std::array<std::string, 10> terrainCodes =
|
||||
{
|
||||
"dt", "sa", "gr", "sn", "sw", "rg", "sb", "lv", "wt", "rc"
|
||||
@ -105,7 +106,6 @@ namespace TerrainDetail{
|
||||
{
|
||||
'_', '-', '|', '+'
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
///CMapFormatJson
|
||||
|
@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE(CMapFormatVCMI_Simple)
|
||||
|
||||
#if 1
|
||||
{
|
||||
auto path = VCMIDirs::get().userDataPath()/"temp.zip";
|
||||
auto path = VCMIDirs::get().userDataPath()/"test.zip";
|
||||
boost::filesystem::remove(path);
|
||||
boost::filesystem::ofstream tmp(path, boost::filesystem::ofstream::binary);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user