mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
All objects that can be owned by player now implement IOwnableObject
This commit is contained in:
@@ -534,4 +534,26 @@ void CGDwelling::serializeJsonOptions(JsonSerializeFormat & handler)
|
||||
}
|
||||
}
|
||||
|
||||
const IOwnableObject * CGDwelling::asOwnable() const
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
ResourceSet CGDwelling::dailyIncome() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<CreatureID> CGDwelling::providedCreatures() const
|
||||
{
|
||||
if (ID == Obj::WAR_MACHINE_FACTORY || ID == Obj::REFUGEE_CAMP)
|
||||
return {};
|
||||
|
||||
std::vector<CreatureID> result;
|
||||
for (const auto & level : creatures)
|
||||
result.insert(result.end(), level.second.begin(), level.second.end());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
||||
Reference in New Issue
Block a user