1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Adventure map shipyard nwo has configurable boat type

This commit is contained in:
Ivan Savenko
2023-06-08 00:04:13 +03:00
parent 487f441f47
commit 4d947be287
11 changed files with 109 additions and 24 deletions

View File

@@ -15,7 +15,6 @@
VCMI_LIB_NAMESPACE_BEGIN
class CMap;
class HillFortInstanceConstructor;
// This one teleport-specific, but has to be available everywhere in callbacks and netpacks
// For now it's will be there till teleports code refactored and moved into own file
@@ -459,12 +458,22 @@ public:
class DLL_LINKAGE CGShipyard : public CGObjectInstance, public IShipyard
{
public:
void getOutOffsets(std::vector<int3> &offsets) const override; //offsets to obj pos when we boat can be placed
friend class ShipyardInstanceConstructor;
BoatId createdBoat;
protected:
void getOutOffsets(std::vector<int3> & offsets) const override;
void onHeroVisit(const CGHeroInstance * h) const override;
const IObjectInterface * getObject() const override;
BoatId getBoatType() const override;
public:
template<typename Handler> void serialize(Handler & h, const int version)
{
h & static_cast<CGObjectInstance&>(*this);
h & createdBoat;
}
protected:
void serializeJsonOptions(JsonSerializeFormat & handler) override;
@@ -558,7 +567,6 @@ class DLL_LINKAGE HillFort : public CGObjectInstance, public ICreatureUpgrader
std::vector<int> upgradeCostPercentage;
protected:
void initObj(CRandomGenerator & rand) override;
void onHeroVisit(const CGHeroInstance * h) const override;
void fillUpgradeInfo(UpgradeInfo & info, const CStackInstance &stack) const override;