本文整理汇总了C++中Controller::SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ Controller::SendMessage方法的具体用法?C++ Controller::SendMessage怎么用?C++ Controller::SendMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Controller
的用法示例。
在下文中一共展示了Controller::SendMessage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateClient
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;
}
示例2: UpdateClient
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));
}
示例3: UpdateClient
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);
}
}
}
示例4: UpdateClient
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));
}
示例5: UpdateClient
void DiscoverCmd::UpdateClient(const Controller& controller, const LiveGame& game) const
{
controller.SendMessage(Output::ChooseDiscovery(m_discovery, CanKeep(), CanUse(game)), GetPlayer(game));
}
示例6: UpdateClient
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));
}
示例7: UpdateClient
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);
}
示例8: UpdateClient
void TradeCmd::UpdateClient(const Controller& controller, const LiveGame& game) const
{
controller.SendMessage(Output::ChooseTrade(GetTeam(game)), GetPlayer(game));
}