mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-24 00:36:29 +02:00
Cleaned up object constructors to reduce duplicated code
This commit is contained in:
@@ -32,11 +32,6 @@ void CBankInstanceConstructor::initTypeData(const JsonNode & input)
|
||||
bankResetDuration = static_cast<si32>(input["resetDuration"].Float());
|
||||
}
|
||||
|
||||
CGObjectInstance *CBankInstanceConstructor::create(std::shared_ptr<const ObjectTemplate> tmpl) const
|
||||
{
|
||||
return createTyped(tmpl);
|
||||
}
|
||||
|
||||
BankConfig CBankInstanceConstructor::generateConfig(const JsonNode & level, CRandomGenerator & rng) const
|
||||
{
|
||||
BankConfig bc;
|
||||
@@ -60,10 +55,8 @@ BankConfig CBankInstanceConstructor::generateConfig(const JsonNode & level, CRan
|
||||
return bc;
|
||||
}
|
||||
|
||||
void CBankInstanceConstructor::configureObject(CGObjectInstance * object, CRandomGenerator & rng) const
|
||||
void CBankInstanceConstructor::randomizeObject(CBank * bank, CRandomGenerator & rng) const
|
||||
{
|
||||
auto * bank = dynamic_cast<CBank *>(object);
|
||||
|
||||
bank->resetDuration = bankResetDuration;
|
||||
|
||||
si32 totalChance = 0;
|
||||
|
||||
Reference in New Issue
Block a user