1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-10 09:50:17 +02:00
vcmi/lib/TurnTimerInfo.h

51 lines
1.2 KiB
C++
Raw Normal View History

2023-08-14 00:16:25 +02:00
/*
* TurnTimerInfo.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
struct DLL_LINKAGE TurnTimerInfo
{
int turnTimer = 0; //in ms, counts down when player is making his turn on adventure map
int baseTimer = 0; //in ms, counts down only when turn timer runs out
int battleTimer = 0; //in ms, counts down during battles when creature timer runs out
int unitTimer = 0; //in ms, counts down when player is choosing action in battle
bool accumulatingTurnTimer = false;
bool accumulatingUnitTimer = false;
2023-08-14 00:16:25 +02:00
2023-08-30 01:33:59 +02:00
bool isActive = false; //is being counting down
bool isBattle = false; //indicator for current timer mode
2023-08-14 00:16:25 +02:00
bool isEnabled() const;
bool isBattleEnabled() const;
2023-12-07 16:36:44 +02:00
void subtractTimer(int timeMs);
int valueMs() const;
bool operator == (const TurnTimerInfo & other) const;
2023-08-14 00:16:25 +02:00
template <typename Handler>
void serialize(Handler &h)
2023-08-14 00:16:25 +02:00
{
h & turnTimer;
h & baseTimer;
h & battleTimer;
h & unitTimer;
h & accumulatingTurnTimer;
h & accumulatingUnitTimer;
h & isActive;
h & isBattle;
2023-08-14 00:16:25 +02:00
}
};
VCMI_LIB_NAMESPACE_END