CArmedInstance.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include "CObjectHandler.h"
  3. #include "../CCreatureSet.h"
  4. /*
  5. * CArmedInstance.h, part of VCMI engine
  6. *
  7. * Authors: listed in file AUTHORS in main folder
  8. *
  9. * License: GNU General Public License v2.0 or later
  10. * Full text of license available in license.txt file, in main folder
  11. *
  12. */
  13. class DLL_LINKAGE CArmedInstance: public CGObjectInstance, public CBonusSystemNode, public CCreatureSet
  14. {
  15. public:
  16. BattleInfo *battle; //set to the current battle, if engaged
  17. void randomizeArmy(int type);
  18. virtual void updateMoraleBonusFromArmy();
  19. void armyChanged() override;
  20. //////////////////////////////////////////////////////////////////////////
  21. // int valOfGlobalBonuses(CSelector selector) const; //used only for castle interface ???
  22. virtual CBonusSystemNode *whereShouldBeAttached(CGameState *gs);
  23. virtual CBonusSystemNode *whatShouldBeAttached();
  24. //////////////////////////////////////////////////////////////////////////
  25. CArmedInstance();
  26. template <typename Handler> void serialize(Handler &h, const int version)
  27. {
  28. h & static_cast<CGObjectInstance&>(*this);
  29. h & static_cast<CBonusSystemNode&>(*this);
  30. h & static_cast<CCreatureSet&>(*this);
  31. }
  32. };