本文整理汇总了C++中Battlefield::IsEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ Battlefield::IsEnabled方法的具体用法?C++ Battlefield::IsEnabled怎么用?C++ Battlefield::IsEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Battlefield
的用法示例。
在下文中一共展示了Battlefield::IsEnabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnConditionCheck
bool OnConditionCheck(Condition const* /* condition */, ConditionSourceInfo& /* sourceInfo */)
{
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
if (wintergrasp && wintergrasp->IsEnabled() && wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE)
return true;
return false;
}
示例2: HandleBattlefieldEnable
static bool HandleBattlefieldEnable(ChatHandler* handler, const char* args)
{
uint32 battleid = 0;
char* battleid_str = strtok((char*)args, " ");
if (!battleid_str)
return false;
battleid = atoi(battleid_str);
Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleid);
if (!bf)
return false;
if (bf->IsEnabled())
{
bf->ToggleBattlefield(false);
if (battleid == 1)
handler->SendGlobalGMSysMessage("Wintergrasp is disabled");
}
else
{
bf->ToggleBattlefield(true);
if (battleid == 1)
handler->SendGlobalGMSysMessage("Wintergrasp is enabled");
}
return true;
}
示例3: HandlePlayerEnterZone
void BattlefieldMgr::HandlePlayerEnterZone(Player* player, uint32 zoneid)
{
BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneid);
if (itr == m_BattlefieldMap.end())
return;
Battlefield* bf = itr->second;
if (bf->HasPlayer(player) || !bf->IsEnabled())
return;
bf->HandlePlayerEnterZone(player, zoneid);
SF_LOG_DEBUG("bg.battlefield", "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), bf->GetTypeId());
}
示例4: HandlePlayerEnterZone
void BattlefieldMgr::HandlePlayerEnterZone(Player* player, uint32 zoneId)
{
BattlefieldMap::iterator itr = _battlefieldMap.find(zoneId);
if (itr == _battlefieldMap.end())
return;
Battlefield* bf = itr->second;
if (!bf->IsEnabled() || bf->HasPlayer(player))
return;
bf->HandlePlayerEnterZone(player, zoneId);
TC_LOG_DEBUG("bg.battlefield", "Player %u entered battlefield id %u", player->GetGUID().GetCounter(), bf->GetTypeId());
}