mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-13 01:20:34 +02:00
Fixes according to review
This commit is contained in:
@ -27,7 +27,7 @@ public:
|
|||||||
virtual void visitPlayerBlocked(PlayerBlocked & pack) {}
|
virtual void visitPlayerBlocked(PlayerBlocked & pack) {}
|
||||||
virtual void visitPlayerCheated(PlayerCheated & pack) {}
|
virtual void visitPlayerCheated(PlayerCheated & pack) {}
|
||||||
virtual void visitYourTurn(YourTurn & pack) {}
|
virtual void visitYourTurn(YourTurn & pack) {}
|
||||||
virtual void visitYourTurn(DaysWithoutTown & pack) {}
|
virtual void visitDaysWithoutTown(DaysWithoutTown & pack) {}
|
||||||
virtual void visitTurnTimeUpdate(TurnTimeUpdate & pack) {}
|
virtual void visitTurnTimeUpdate(TurnTimeUpdate & pack) {}
|
||||||
virtual void visitEntitiesChanged(EntitiesChanged & pack) {}
|
virtual void visitEntitiesChanged(EntitiesChanged & pack) {}
|
||||||
virtual void visitSetResources(SetResources & pack) {}
|
virtual void visitSetResources(SetResources & pack) {}
|
||||||
|
@ -110,7 +110,7 @@ void YourTurn::visitTyped(ICPackVisitor & visitor)
|
|||||||
|
|
||||||
void DaysWithoutTown::visitTyped(ICPackVisitor & visitor)
|
void DaysWithoutTown::visitTyped(ICPackVisitor & visitor)
|
||||||
{
|
{
|
||||||
visitor.visitYourTurn(*this);
|
visitor.visitDaysWithoutTown(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntitiesChanged::visitTyped(ICPackVisitor & visitor)
|
void EntitiesChanged::visitTyped(ICPackVisitor & visitor)
|
||||||
|
@ -108,7 +108,7 @@ void TurnOrderProcessor::doStartPlayerTurn(PlayerColor which)
|
|||||||
|
|
||||||
void TurnOrderProcessor::doEndPlayerTurn(PlayerColor which)
|
void TurnOrderProcessor::doEndPlayerTurn(PlayerColor which)
|
||||||
{
|
{
|
||||||
assert(playerMakingTurn(which));
|
assert(isPlayerMakingTurn(which));
|
||||||
assert(gameHandler->getPlayerStatus(which) == EPlayerStatus::INGAME);
|
assert(gameHandler->getPlayerStatus(which) == EPlayerStatus::INGAME);
|
||||||
|
|
||||||
actingPlayers.erase(which);
|
actingPlayers.erase(which);
|
||||||
@ -149,7 +149,7 @@ void TurnOrderProcessor::onPlayerEndsGame(PlayerColor which)
|
|||||||
|
|
||||||
bool TurnOrderProcessor::onPlayerEndsTurn(PlayerColor which)
|
bool TurnOrderProcessor::onPlayerEndsTurn(PlayerColor which)
|
||||||
{
|
{
|
||||||
if (!playerMakingTurn(which))
|
if (!isPlayerMakingTurn(which))
|
||||||
{
|
{
|
||||||
gameHandler->complain("Can not end turn for player that is not acting!");
|
gameHandler->complain("Can not end turn for player that is not acting!");
|
||||||
return false;
|
return false;
|
||||||
@ -197,17 +197,17 @@ void TurnOrderProcessor::tryStartTurnsForPlayers()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TurnOrderProcessor::playerAwaitsTurn(PlayerColor which) const
|
bool TurnOrderProcessor::isPlayerAwaitsTurn(PlayerColor which) const
|
||||||
{
|
{
|
||||||
return vstd::contains(awaitingPlayers, which);
|
return vstd::contains(awaitingPlayers, which);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TurnOrderProcessor::playerMakingTurn(PlayerColor which) const
|
bool TurnOrderProcessor::isPlayerMakingTurn(PlayerColor which) const
|
||||||
{
|
{
|
||||||
return vstd::contains(actingPlayers, which);
|
return vstd::contains(actingPlayers, which);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TurnOrderProcessor::playerAwaitsNewDay(PlayerColor which) const
|
bool TurnOrderProcessor::isPlayerAwaitsNewDay(PlayerColor which) const
|
||||||
{
|
{
|
||||||
return vstd::contains(actedPlayers, which);
|
return vstd::contains(actedPlayers, which);
|
||||||
}
|
}
|
||||||
|
@ -37,9 +37,9 @@ class TurnOrderProcessor : boost::noncopyable
|
|||||||
void doStartPlayerTurn(PlayerColor which);
|
void doStartPlayerTurn(PlayerColor which);
|
||||||
void doEndPlayerTurn(PlayerColor which);
|
void doEndPlayerTurn(PlayerColor which);
|
||||||
|
|
||||||
bool playerAwaitsTurn(PlayerColor which) const;
|
bool isPlayerAwaitsTurn(PlayerColor which) const;
|
||||||
bool playerMakingTurn(PlayerColor which) const;
|
bool isPlayerMakingTurn(PlayerColor which) const;
|
||||||
bool playerAwaitsNewDay(PlayerColor which) const;
|
bool isPlayerAwaitsNewDay(PlayerColor which) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TurnOrderProcessor(CGameHandler * owner);
|
TurnOrderProcessor(CGameHandler * owner);
|
||||||
|
Reference in New Issue
Block a user