Browse Source

Implement IOwnableObject interface for shipyard

Ivan Savenko 1 year ago
parent
commit
dae9e1e316
2 changed files with 20 additions and 1 deletions
  1. 15 0
      lib/mapObjects/MiscObjects.cpp
  2. 5 1
      lib/mapObjects/MiscObjects.h

+ 15 - 0
lib/mapObjects/MiscObjects.cpp

@@ -1227,6 +1227,21 @@ BoatId CGShipyard::getBoatType() const
 	return createdBoat;
 }
 
+const IOwnableObject * CGShipyard::asOwnable() const
+{
+	return this;
+}
+
+ResourceSet CGShipyard::dailyIncome() const
+{
+	return {};
+}
+
+std::vector<CreatureID> CGShipyard::providedCreatures() const
+{
+	return {};
+}
+
 void CGDenOfthieves::onHeroVisit (const CGHeroInstance * h) const
 {
 	cb->showObjectWindow(this, EOpenWindowMode::THIEVES_GUILD, h, false);

+ 5 - 1
lib/mapObjects/MiscObjects.h

@@ -346,7 +346,7 @@ public:
 	}
 };
 
-class DLL_LINKAGE CGShipyard : public CGObjectInstance, public IShipyard
+class DLL_LINKAGE CGShipyard : public CGObjectInstance, public IShipyard, public IOwnableObject
 {
 	friend class ShipyardInstanceConstructor;
 
@@ -358,6 +358,10 @@ protected:
 	const IObjectInterface * getObject() const override;
 	BoatId getBoatType() const override;
 
+	const IOwnableObject * asOwnable() const final;
+	ResourceSet dailyIncome() const override;
+	std::vector<CreatureID> providedCreatures() const override;
+
 public:
 	using CGObjectInstance::CGObjectInstance;