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 == ¤tPlayer) controller.SendMessage(Output::ChooseTeam(GetGame(), true), currentPlayer); return; }
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)); }
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); } } }
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)); }
void DiscoverCmd::UpdateClient(const Controller& controller, const LiveGame& game) const { controller.SendMessage(Output::ChooseDiscovery(m_discovery, CanKeep(), CanUse(game)), GetPlayer(game)); }
void ColoniseCmd::UpdateClient(const Controller& controller, const LiveGame& game) const { controller.SendMessage(Output::ChooseColonisePos(GetPositions(game)), GetPlayer(game)); }
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)); }
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); }
void CombatCmd::UpdateClient(const Controller& controller, const LiveGame& game) const { controller.SendMessage(Output::ChooseCombat(game), GetPlayer(game)); }
void TradeCmd::UpdateClient(const Controller& controller, const LiveGame& game) const { controller.SendMessage(Output::ChooseTrade(GetTeam(game)), GetPlayer(game)); }