当前位置: 首页>>代码示例>>C++>>正文


C++ Controller::SendMessage方法代码示例

本文整理汇总了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 == &currentPlayer)
		controller.SendMessage(Output::ChooseTeam(GetGame(), true), currentPlayer);

	return;
}
开发者ID:molip,项目名称:Eclipsoid,代码行数:12,代码来源:ChooseTeamPhase.cpp

示例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));
}
开发者ID:molip,项目名称:Eclipsoid,代码行数:7,代码来源:ColoniseCmd.cpp

示例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);
		}
	}
}
开发者ID:molip,项目名称:Eclipsoid,代码行数:18,代码来源:UpkeepPhase.cpp

示例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));
}
开发者ID:molip,项目名称:Eclipsoid,代码行数:5,代码来源:BankruptCmd.cpp

示例5: UpdateClient

void DiscoverCmd::UpdateClient(const Controller& controller, const LiveGame& game) const
{
	controller.SendMessage(Output::ChooseDiscovery(m_discovery, CanKeep(), CanUse(game)), GetPlayer(game));
}
开发者ID:molip,项目名称:Eclipsoid,代码行数:4,代码来源:DiscoverCmd.cpp

示例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));
}
开发者ID:molip,项目名称:Eclipsoid,代码行数:5,代码来源:AutoInfluenceCmd.cpp

示例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);
}
开发者ID:molip,项目名称:Eclipsoid,代码行数:6,代码来源:CombatCmd.cpp

示例8: UpdateClient

void TradeCmd::UpdateClient(const Controller& controller, const LiveGame& game) const
{
	controller.SendMessage(Output::ChooseTrade(GetTeam(game)), GetPlayer(game));
}
开发者ID:molip,项目名称:Eclipsoid,代码行数:4,代码来源:TradeCmd.cpp


注:本文中的Controller::SendMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。