CNonConstInfoCallback.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * CNonConstInfoCallback.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "CGameInfoCallback.h"
  12. #include <vcmi/Metatype.h>
  13. VCMI_LIB_NAMESPACE_BEGIN
  14. class JsonNode;
  15. class DLL_LINKAGE CNonConstInfoCallback : public CGameInfoCallback
  16. {
  17. public:
  18. //keep const version of callback accessible
  19. using CGameInfoCallback::getPlayerState;
  20. using CGameInfoCallback::getTeam;
  21. using CGameInfoCallback::getPlayerTeam;
  22. using CGameInfoCallback::getHero;
  23. using CGameInfoCallback::getTown;
  24. using CGameInfoCallback::getTile;
  25. using CGameInfoCallback::getArtInstance;
  26. using CGameInfoCallback::getObjInstance;
  27. using CGameInfoCallback::getArtSet;
  28. PlayerState * getPlayerState(const PlayerColor & color, bool verbose = true);
  29. TeamState * getTeam(const TeamID & teamID); //get team by team ID
  30. TeamState * getPlayerTeam(const PlayerColor & color); // get team by player color
  31. CGHeroInstance * getHero(const ObjectInstanceID & objid);
  32. CGTownInstance * getTown(const ObjectInstanceID & objid);
  33. TerrainTile * getTile(const int3 & pos);
  34. CArtifactInstance * getArtInstance(const ArtifactInstanceID & aid);
  35. CGObjectInstance * getObjInstance(const ObjectInstanceID & oid);
  36. CArmedInstance * getArmyInstance(const ObjectInstanceID & oid);
  37. CArtifactSet * getArtSet(const ArtifactLocation & loc);
  38. virtual void updateEntity(Metatype metatype, int32_t index, const JsonNode & data) = 0;
  39. };
  40. VCMI_LIB_NAMESPACE_END