Browse Source

Removed non-functional updateEntity in VLC

Ivan Savenko 1 year ago
parent
commit
07813c9a79
7 changed files with 1 additions and 55 deletions
  1. 0 5
      client/CGameInfo.cpp
  2. 0 2
      client/CGameInfo.h
  3. 0 2
      include/vcmi/Services.h
  4. 0 12
      lib/IHandlerBase.h
  5. 0 31
      lib/VCMI_Lib.cpp
  6. 0 2
      lib/VCMI_Lib.h
  7. 1 1
      lib/gameState/CGameState.cpp

+ 0 - 5
client/CGameInfo.cpp

@@ -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;

+ 0 - 2
client/CGameInfo.h

@@ -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;
 

+ 0 - 2
include/vcmi/Services.h

@@ -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

+ 0 - 12
lib/IHandlerBase.h

@@ -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();

+ 0 - 31
lib/VCMI_Lib.cpp

@@ -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;

+ 0 - 2
lib/VCMI_Lib.h

@@ -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;
 

+ 1 - 1
lib/gameState/CGameState.cpp

@@ -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;
 	}
 }