CArmedInstance.h 1.3 KB

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