1
0
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:
Ivan Savenko
2024-08-25 15:04:44 +00:00
parent a481f07daf
commit d49a61645c
18 changed files with 131 additions and 73 deletions

View File

@@ -132,6 +132,11 @@ const IOwnableObject * CGMine::asOwnable() const
return this;
}
std::vector<CreatureID> CGMine::providedCreatures() const
{
return {};
}
ResourceSet CGMine::dailyIncome() const
{
ResourceSet result;
@@ -974,6 +979,21 @@ void CGSignBottle::serializeJsonOptions(JsonSerializeFormat& handler)
handler.serializeStruct("text", message);
}
const IOwnableObject * CGGarrison::asOwnable() const
{
return this;
}
ResourceSet CGGarrison::dailyIncome() const
{
return {};
}
std::vector<CreatureID> CGGarrison::providedCreatures() const
{
return {};
}
void CGGarrison::onHeroVisit (const CGHeroInstance *h) const
{
auto relations = cb->gameState()->getPlayerRelations(h->tempOwner, tempOwner);
@@ -1277,6 +1297,21 @@ void CGObelisk::setPropertyDer(ObjProperty what, ObjPropertyID identifier)
}
}
const IOwnableObject * CGLighthouse::asOwnable() const
{
return this;
}
ResourceSet CGLighthouse::dailyIncome() const
{
return {};
}
std::vector<CreatureID> CGLighthouse::providedCreatures() const
{
return {};
}
void CGLighthouse::onHeroVisit( const CGHeroInstance * h ) const
{
if(h->tempOwner != tempOwner)