1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-30 23:18:08 +02:00

Removed non-functional updateEntity in VLC

This commit is contained in:
Ivan Savenko 2024-05-16 22:05:26 +00:00
parent 1f1e693a5b
commit 07813c9a79
7 changed files with 1 additions and 55 deletions

View File

@ -97,11 +97,6 @@ const IGameSettings * CGameInfo::settings() const
return globalServices->settings();
}
void CGameInfo::updateEntity(Metatype metatype, int32_t index, const JsonNode & data)
{
logGlobal->error("CGameInfo::updateEntity call is not expected.");
}
spells::effects::Registry * CGameInfo::spellEffects()
{
return nullptr;

View File

@ -73,8 +73,6 @@ public:
const ObstacleService * obstacles() const override;
const IGameSettings * settings() const override;
void updateEntity(Metatype metatype, int32_t index, const JsonNode & data) override;
const spells::effects::Registry * spellEffects() const override;
spells::effects::Registry * spellEffects() override;

View File

@ -61,8 +61,6 @@ public:
virtual const ObstacleService * obstacles() const = 0;
virtual const IGameSettings * settings() const = 0;
virtual void updateEntity(Metatype metatype, int32_t index, const JsonNode & data) = 0;
virtual const spells::effects::Registry * spellEffects() const = 0;
virtual spells::effects::Registry * spellEffects() = 0;
//TODO: put map object types registry access here

View File

@ -124,18 +124,6 @@ public:
return getObjectImpl(index);
}
void updateEntity(int32_t index, const JsonNode & data)
{
if(index < 0 || index >= objects.size())
{
logMod->error("%s id %d is invalid", getTypeNames()[0], index);
}
else
{
objects.at(index)->updateFrom(data);
}
}
size_t size() const
{
return objects.size();

View File

@ -141,37 +141,6 @@ const IGameSettings * LibClasses::settings() const
return settingsHandler.get();
}
void LibClasses::updateEntity(Metatype metatype, int32_t index, const JsonNode & data)
{
switch(metatype)
{
case Metatype::ARTIFACT:
arth->updateEntity(index, data);
break;
case Metatype::CREATURE:
creh->updateEntity(index, data);
break;
case Metatype::FACTION:
townh->updateEntity(index, data);
break;
case Metatype::HERO_CLASS:
heroclassesh->updateEntity(index, data);
break;
case Metatype::HERO_TYPE:
heroh->updateEntity(index, data);
break;
case Metatype::SKILL:
skillh->updateEntity(index, data);
break;
case Metatype::SPELL:
spellh->updateEntity(index, data);
break;
default:
logGlobal->error("Invalid Metatype id %d", static_cast<int32_t>(metatype));
break;
}
}
void LibClasses::loadFilesystem(bool extractArchives)
{
CStopWatch loadTime;

View File

@ -72,8 +72,6 @@ public:
const ObstacleService * obstacles() const override;
const IGameSettings * settings() const override;
void updateEntity(Metatype metatype, int32_t index, const JsonNode & data) override;
const spells::effects::Registry * spellEffects() const override;
spells::effects::Registry * spellEffects() override;

View File

@ -282,7 +282,7 @@ void CGameState::updateEntity(Metatype metatype, int32_t index, const JsonNode &
}
break;
default:
services->updateEntity(metatype, index, data);
logGlobal->error("This metatype update is not implemented");
break;
}
}