2023-08-14 01:20:27 +02:00
|
|
|
/*
|
|
|
|
* TurnTimerHandler.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
|
|
|
|
|
2023-08-14 21:31:44 +02:00
|
|
|
class CStack;
|
2023-08-14 01:20:27 +02:00
|
|
|
class PlayerColor;
|
2023-08-26 03:39:29 +02:00
|
|
|
struct TurnTimerInfo;
|
2023-08-14 01:20:27 +02:00
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|
|
|
|
|
|
|
|
class CGameHandler;
|
|
|
|
|
|
|
|
class TurnTimerHandler
|
|
|
|
{
|
|
|
|
CGameHandler & gameHandler;
|
|
|
|
const int turnTimePropagateFrequency = 5000;
|
2023-08-14 21:31:44 +02:00
|
|
|
const int turnTimePropagateFrequencyCrit = 1000;
|
|
|
|
const int turnTimePropagateThreshold = 3000;
|
2023-08-26 03:39:29 +02:00
|
|
|
std::map<PlayerColor, TurnTimerInfo> timers;
|
2023-08-14 01:20:27 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
TurnTimerHandler(CGameHandler &);
|
|
|
|
|
2023-08-26 03:39:29 +02:00
|
|
|
void onGameplayStart(PlayerColor player);
|
|
|
|
void onPlayerGetTurn(PlayerColor player);
|
|
|
|
void onPlayerMakingTurn(PlayerColor player, int waitTime);
|
2023-08-22 12:14:50 +02:00
|
|
|
void onBattleStart();
|
2023-08-21 23:49:50 +02:00
|
|
|
void onBattleNextStack(const CStack & stack);
|
|
|
|
void onBattleLoop(int waitTime);
|
2023-08-14 01:20:27 +02:00
|
|
|
};
|