mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Changes following review:
- shared_ptr for destructibleEnemyTurns instead of raw pointer - drop implicit int conversion for BattleHex class and implement toInt() instead - implement necessary operators in BattleHex - adjust code to work properly with JSON serializer
This commit is contained in:
@@ -754,7 +754,14 @@ std::vector<int> CSpellHandler::spellRangeInHexes(std::string input) const
|
||||
}
|
||||
}
|
||||
|
||||
return std::vector<int>(ret.begin(), ret.end());
|
||||
std::vector<int> result;
|
||||
result.reserve(ret.size());
|
||||
|
||||
std::transform(ret.begin(), ret.end(), std::back_inserter(result),
|
||||
[](BattleHex hex) { return hex.toInt(); }
|
||||
);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
std::shared_ptr<CSpell> CSpellHandler::loadFromJson(const std::string & scope, const JsonNode & json, const std::string & identifier, size_t index)
|
||||
|
||||
Reference in New Issue
Block a user