CArmedInstance.h 1.4 KB

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