mirror of
https://github.com/vcmi/vcmi.git
synced 2026-05-16 09:28:24 +02:00
Add game pause
This commit is contained in:
@@ -15,28 +15,28 @@
|
||||
#include "../../lib/mapObjects/MiscObjects.h"
|
||||
#include "../../lib/serializer/Cast.h"
|
||||
|
||||
PlayerStartsTurnQuery::PlayerStartsTurnQuery(CGameHandler * owner, PlayerColor player):
|
||||
TimerPauseQuery::TimerPauseQuery(CGameHandler * owner, PlayerColor player):
|
||||
CQuery(owner)
|
||||
{
|
||||
addPlayer(player);
|
||||
}
|
||||
|
||||
bool PlayerStartsTurnQuery::blocksPack(const CPack *pack) const
|
||||
bool TimerPauseQuery::blocksPack(const CPack *pack) const
|
||||
{
|
||||
return blockAllButReply(pack);
|
||||
}
|
||||
|
||||
void PlayerStartsTurnQuery::onAdding(PlayerColor color)
|
||||
void TimerPauseQuery::onAdding(PlayerColor color)
|
||||
{
|
||||
gh->turnTimerHandler.setTimerEnabled(color, false);
|
||||
}
|
||||
|
||||
void PlayerStartsTurnQuery::onRemoval(PlayerColor color)
|
||||
void TimerPauseQuery::onRemoval(PlayerColor color)
|
||||
{
|
||||
gh->turnTimerHandler.setTimerEnabled(color, true);
|
||||
}
|
||||
|
||||
bool PlayerStartsTurnQuery::endsByPlayerAnswer() const
|
||||
bool TimerPauseQuery::endsByPlayerAnswer() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
|
||||
class TurnTimerHandler;
|
||||
|
||||
//Created when player starts turn
|
||||
//Removed when player accepts a turn
|
||||
class PlayerStartsTurnQuery : public CQuery
|
||||
//Created when player starts turn or when player puts game on [ause
|
||||
//Removed when player accepts a turn or continur play
|
||||
class TimerPauseQuery : public CQuery
|
||||
{
|
||||
public:
|
||||
PlayerStartsTurnQuery(CGameHandler * owner, PlayerColor player);
|
||||
TimerPauseQuery(CGameHandler * owner, PlayerColor player);
|
||||
|
||||
bool blocksPack(const CPack *pack) const override;
|
||||
void onAdding(PlayerColor color) override;
|
||||
|
||||
Reference in New Issue
Block a user