mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Implemented boat selection for town shipyards
This commit is contained in:
@@ -289,11 +289,25 @@ CGObjectInstance * BoatInstanceConstructor::create(std::shared_ptr<const ObjectT
|
||||
return boat;
|
||||
}
|
||||
|
||||
std::string BoatInstanceConstructor::getBoatAnimationName() const
|
||||
{
|
||||
return actualAnimation;
|
||||
}
|
||||
|
||||
void BoatInstanceConstructor::configureObject(CGObjectInstance * object, CRandomGenerator & rng) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BoatInstanceConstructor::afterLoadFinalization()
|
||||
{
|
||||
if (layer == EPathfindingLayer::SAIL)
|
||||
{
|
||||
if (getTemplates(TerrainId(ETerrainId::WATER)).empty())
|
||||
logMod->warn("Boat of type %s has no templates suitable for water!", getJsonKey());
|
||||
}
|
||||
}
|
||||
|
||||
void MarketInstanceConstructor::initTypeData(const JsonNode & input)
|
||||
{
|
||||
for(auto & element : input["modes"].Vector())
|
||||
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class BoatInstanceConstructor : public CDefaultObjectTypeHandler<CGBoat>
|
||||
class DLL_LINKAGE BoatInstanceConstructor : public CDefaultObjectTypeHandler<CGBoat>
|
||||
{
|
||||
protected:
|
||||
void initTypeData(const JsonNode & config) override;
|
||||
@@ -127,6 +127,10 @@ protected:
|
||||
public:
|
||||
CGObjectInstance * create(std::shared_ptr<const ObjectTemplate> tmpl = nullptr) const override;
|
||||
void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const override;
|
||||
void afterLoadFinalization() override;
|
||||
|
||||
/// Returns boat preview animation, for use in Shipyards
|
||||
std::string getBoatAnimationName() const;
|
||||
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user