Ejemplo n.º 1
0
void ChooseTeamPhase::UpdateClient(const Controller& controller, const Player* pPlayer) const
{
	controller.SendMessage(Output::ShowChoose(), GetGame(), pPlayer);
	controller.SendMessage(Output::UpdateChoose(GetGame()), GetGame(), pPlayer);

	const Player& currentPlayer = Players::Get(GetCurrentTeam().GetPlayerID());

	if (!pPlayer || pPlayer == &currentPlayer)
		controller.SendMessage(Output::ChooseTeam(GetGame(), true), currentPlayer);

	return;
}
Ejemplo n.º 2
0
void ColoniseSquaresCmd::UpdateClient(const Controller& controller, const LiveGame& game) const
{
	auto& team = GetTeam(game);
	const Population& pop = team.GetPopulationTrack().GetPopulation();
	int nShips = team.GetUnusedColonyShips();
	controller.SendMessage(Output::ChooseColoniseSquares(m_pos, GetSquareCounts(game), pop, nShips), GetPlayer(game));
}
Ejemplo n.º 3
0
void UpkeepPhase::UpdateClient(const Controller& controller, const Player* pPlayer) const
{
	for (auto& team : GetGame().GetTeams())
	{
		const Player& playerSend = team->GetPlayer();
		if (!pPlayer || pPlayer == &playerSend)
		{
			const Colour c = team->GetColour();
			const CmdStack& cmdStack = GetCmdStack(c);
			if (const Cmd* pCmd = cmdStack.GetCurrentCmd())
				pCmd->UpdateClient(controller, GetGame());
			else if (m_finished.find(c) == m_finished.end())
				controller.SendMessage(Output::ChooseUpkeep(*team, cmdStack.CanRemoveCmd()), playerSend);
			else
				controller.SendMessage(Output::ChooseFinished(), playerSend);
		}
	}
}
Ejemplo n.º 4
0
void BankruptCmd::UpdateClient(const Controller& controller, const LiveGame& game) const
{
	bool canChooseTrack = GetTeam(game).GetInfluenceTrack().GetDiscCount() > 0;
	controller.SendMessage(Output::ChooseInfluenceSrc(GetSources(game), false, false, 0), GetPlayer(game));
}
Ejemplo n.º 5
0
void DiscoverCmd::UpdateClient(const Controller& controller, const LiveGame& game) const
{
	controller.SendMessage(Output::ChooseDiscovery(m_discovery, CanKeep(), CanUse(game)), GetPlayer(game));
}
Ejemplo n.º 6
0
void ColoniseCmd::UpdateClient(const Controller& controller, const LiveGame& game) const
{
	controller.SendMessage(Output::ChooseColonisePos(GetPositions(game)), GetPlayer(game));
}
Ejemplo n.º 7
0
void AutoInfluenceCmd::UpdateClient(const Controller& controller, const LiveGame& game) const
{
	bool canChooseTrack = GetTeam(game).GetInfluenceTrack().GetDiscCount() > 0;
	controller.SendMessage(Output::ChooseAutoInfluence(GetHexes(game)), GetPlayer(game));
}
Ejemplo n.º 8
0
void CombatDiceCmd::UpdateClient(const Controller& controller, const LiveGame& game) const
{
	// Send to all players. 
	// TODO: send hittable target ships.
	controller.SendMessage(Output::ChooseDice(game, m_dice, GetPlayer(game).GetID()), game);
}
Ejemplo n.º 9
0
void CombatCmd::UpdateClient(const Controller& controller, const LiveGame& game) const
{
	controller.SendMessage(Output::ChooseCombat(game), GetPlayer(game));
}
Ejemplo n.º 10
0
void TradeCmd::UpdateClient(const Controller& controller, const LiveGame& game) const
{
	controller.SendMessage(Output::ChooseTrade(GetTeam(game)), GetPlayer(game));
}