mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Implemented configurable blacksmith. Deprecated ballistaYard type
This commit is contained in:
@@ -1176,6 +1176,31 @@ TerrainId CGTownInstance::getNativeTerrain() const
|
||||
return town->faction->getNativeTerrain();
|
||||
}
|
||||
|
||||
ArtifactID CGTownInstance::getWarMachineInBuilding(BuildingID building) const
|
||||
{
|
||||
if (builtBuildings.count(building) == 0)
|
||||
return ArtifactID::NONE;
|
||||
|
||||
if (building == BuildingID::BLACKSMITH && town->warMachineDeprecated.hasValue())
|
||||
return town->warMachineDeprecated.toCreature()->warMachine;
|
||||
|
||||
return town->buildings.at(building)->warMachine;
|
||||
}
|
||||
|
||||
bool CGTownInstance::isWarMachineAvailable(ArtifactID warMachine) const
|
||||
{
|
||||
for (auto const & buildingID : builtBuildings)
|
||||
if (town->buildings.at(buildingID)->warMachine == warMachine)
|
||||
return true;
|
||||
|
||||
if (builtBuildings.count(BuildingID::BLACKSMITH) &&
|
||||
town->warMachineDeprecated.hasValue() &&
|
||||
town->warMachineDeprecated.toCreature()->warMachine == warMachine)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
GrowthInfo::Entry::Entry(const std::string &format, int _count)
|
||||
: count(_count)
|
||||
{
|
||||
|
Reference in New Issue
Block a user