mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Refactoring of H3M loader to make HotA format support easier
- extracted low-level reader from MapFormatH3M class - added separate structure to define version-specific values - cleared up some H3M format edge cases - replaced witch hut skill vector with set - converted several fields to enum type
This commit is contained in:
@@ -634,7 +634,7 @@ CGTownInstance::CGTownInstance():
|
||||
builded(0),
|
||||
destroyed(0),
|
||||
identifier(0),
|
||||
alignment(0xff)
|
||||
alignmentToPlayer(PlayerColor::NEUTRAL)
|
||||
{
|
||||
this->setNodeType(CBonusSystemNode::TOWN);
|
||||
}
|
||||
@@ -1494,9 +1494,11 @@ void CGTownInstance::reset()
|
||||
|
||||
void CGTownInstance::serializeJsonOptions(JsonSerializeFormat & handler)
|
||||
{
|
||||
static const std::vector<std::string> FORMATIONS = { "wide", "tight" };
|
||||
|
||||
CGObjectInstance::serializeJsonOwner(handler);
|
||||
CCreatureSet::serializeJson(handler, "army", 7);
|
||||
handler.serializeBool<ui8>("tightFormation", formation, 1, 0, 0);
|
||||
handler.serializeEnum("tightFormation", formation, FORMATIONS);
|
||||
handler.serializeString("name", name);
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user