1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00
vcmi/server/TurnTimerHandler.h

41 lines
916 B
C
Raw Normal View History

/*
* 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;
class PlayerColor;
2023-08-26 03:39:29 +02:00
struct TurnTimerInfo;
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;
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);
void onBattleStart();
2023-08-21 23:49:50 +02:00
void onBattleNextStack(const CStack & stack);
void onBattleLoop(int waitTime);
};