TurnTimerInfo.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * TurnTimerInfo.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. VCMI_LIB_NAMESPACE_BEGIN
  12. struct DLL_LINKAGE TurnTimerInfo
  13. {
  14. int turnTimer = 0; //in ms, counts down when player is making his turn on adventure map
  15. int baseTimer = 0; //in ms, counts down only when turn timer runs out
  16. int battleTimer = 0; //in ms, counts down during battles when creature timer runs out
  17. int unitTimer = 0; //in ms, counts down when player is choosing action in battle
  18. bool accumulatingTurnTimer = false;
  19. bool accumulatingUnitTimer = false;
  20. bool isActive = false; //is being counting down
  21. bool isBattle = false; //indicator for current timer mode
  22. bool isEnabled() const;
  23. bool isBattleEnabled() const;
  24. void subtractTimer(int timeMs);
  25. int valueMs() const;
  26. bool operator == (const TurnTimerInfo & other) const;
  27. template <typename Handler>
  28. void serialize(Handler &h)
  29. {
  30. h & turnTimer;
  31. h & baseTimer;
  32. h & battleTimer;
  33. h & unitTimer;
  34. h & accumulatingTurnTimer;
  35. h & accumulatingUnitTimer;
  36. h & isActive;
  37. h & isBattle;
  38. }
  39. };
  40. VCMI_LIB_NAMESPACE_END