mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Removed non-functional updateEntity in VLC
This commit is contained in:
parent
1f1e693a5b
commit
07813c9a79
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user