mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
vcmi: modernize lib/battle
This commit is contained in:
@@ -59,7 +59,7 @@ std::vector<BattleHex> Unit::getSurroundingHexes(BattleHex position, bool twoHex
|
||||
|
||||
if(side == BattleSide::ATTACKER)
|
||||
{
|
||||
for(BattleHex::EDir dir = BattleHex::EDir(0); dir <= BattleHex::EDir(4); dir = BattleHex::EDir(dir+1))
|
||||
for(auto dir = static_cast<BattleHex::EDir>(0); dir <= static_cast<BattleHex::EDir>(4); dir = static_cast<BattleHex::EDir>(dir + 1))
|
||||
BattleHex::checkAndPush(position.cloneInDirection(dir, false), hexes);
|
||||
|
||||
BattleHex::checkAndPush(otherHex.cloneInDirection(BattleHex::EDir::BOTTOM_LEFT, false), hexes);
|
||||
@@ -70,7 +70,7 @@ std::vector<BattleHex> Unit::getSurroundingHexes(BattleHex position, bool twoHex
|
||||
{
|
||||
BattleHex::checkAndPush(position.cloneInDirection(BattleHex::EDir::TOP_LEFT, false), hexes);
|
||||
|
||||
for(BattleHex::EDir dir = BattleHex::EDir(0); dir <= BattleHex::EDir(4); dir = BattleHex::EDir(dir+1))
|
||||
for(auto dir = static_cast<BattleHex::EDir>(0); dir <= static_cast<BattleHex::EDir>(4); dir = static_cast<BattleHex::EDir>(dir + 1))
|
||||
BattleHex::checkAndPush(otherHex.cloneInDirection(dir, false), hexes);
|
||||
|
||||
BattleHex::checkAndPush(position.cloneInDirection(BattleHex::EDir::BOTTOM_LEFT, false), hexes);
|
||||
@@ -206,16 +206,6 @@ int Unit::getRawSurrenderCost() const
|
||||
}
|
||||
|
||||
///UnitInfo
|
||||
UnitInfo::UnitInfo()
|
||||
: id(0),
|
||||
count(0),
|
||||
type(),
|
||||
side(0),
|
||||
position(),
|
||||
summoned(false)
|
||||
{
|
||||
}
|
||||
|
||||
void UnitInfo::serializeJson(JsonSerializeFormat & handler)
|
||||
{
|
||||
handler.serializeInt("count", count);
|
||||
|
||||
Reference in New Issue
Block a user