CArmedInstance.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * CArmedInstance.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 "CObjectHandler.h"
  12. #include "../CCreatureSet.h"
  13. struct BattleInfo;
  14. class CGameState;
  15. class DLL_LINKAGE CArmedInstance: public CGObjectInstance, public CBonusSystemNode, public CCreatureSet
  16. {
  17. public:
  18. BattleInfo *battle; //set to the current battle, if engaged
  19. void randomizeArmy(int type);
  20. virtual void updateMoraleBonusFromArmy();
  21. void armyChanged() override;
  22. //////////////////////////////////////////////////////////////////////////
  23. // int valOfGlobalBonuses(CSelector selector) const; //used only for castle interface ???
  24. virtual CBonusSystemNode *whereShouldBeAttached(CGameState *gs);
  25. virtual CBonusSystemNode *whatShouldBeAttached();
  26. //////////////////////////////////////////////////////////////////////////
  27. CArmedInstance();
  28. template <typename Handler> void serialize(Handler &h, const int version)
  29. {
  30. h & static_cast<CGObjectInstance&>(*this);
  31. h & static_cast<CBonusSystemNode&>(*this);
  32. h & static_cast<CCreatureSet&>(*this);
  33. }
  34. };