本文整理汇总了C++中CalendarEvent::GetInviteMap方法的典型用法代码示例。如果您正苦于以下问题:C++ CalendarEvent::GetInviteMap方法的具体用法?C++ CalendarEvent::GetInviteMap怎么用?C++ CalendarEvent::GetInviteMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CalendarEvent
的用法示例。
在下文中一共展示了CalendarEvent::GetInviteMap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CopyEvent
// copy event to another date (all invitee is copied too but their status are reseted)
void CalendarMgr::CopyEvent(uint64 eventId, time_t newTime, ObjectGuid const& guid)
{
Player* player = sObjectMgr.GetPlayer(guid);
CalendarEvent* event = GetEventById(eventId);
if (!event)
{
SendCalendarCommandResult(player, CALENDAR_ERROR_EVENT_INVALID);
return;
}
CalendarEvent* newEvent = AddEvent(guid, event->Title, event->Description, event->Type, event->Repeatable,
CALENDAR_MAX_INVITES, event->DungeonId, newTime, event->UnknownTime, event->Flags);
if (!newEvent)
return;
if (newEvent->IsGuildAnnouncement())
AddInvite(newEvent, guid, guid, CALENDAR_STATUS_CONFIRMED, CALENDAR_RANK_OWNER, "", time(NULL));
else
{
// copy all invitees, set new owner as the one who make the copy, set invitees status to invited
CalendarInviteMap const* cInvMap = event->GetInviteMap();
CalendarInviteMap::const_iterator ci_itr = cInvMap->begin();
while (ci_itr != cInvMap->end())
{
const CalendarInvite* invite = ci_itr->second;
if (invite->InviteeGuid == guid)
{
AddInvite(newEvent, guid, invite->InviteeGuid, CALENDAR_STATUS_CONFIRMED, CALENDAR_RANK_OWNER, "", time(NULL));
}
else
{
CalendarModerationRank rank = CALENDAR_RANK_PLAYER;
// copy moderator rank
if (invite->Rank == CALENDAR_RANK_MODERATOR)
rank = CALENDAR_RANK_MODERATOR;
AddInvite(newEvent, guid, invite->InviteeGuid, CALENDAR_STATUS_INVITED, rank, "", time(NULL));
}
++ci_itr;
}
}
SendCalendarEvent(player, newEvent, CALENDAR_SENDTYPE_COPY);
}
示例2: GetPlayerInvitesList
// fill all player invites in provided CalendarInvitesList
void CalendarMgr::GetPlayerInvitesList(ObjectGuid const& guid, CalendarInvitesList& calInvList)
{
for (CalendarEventStore::iterator itr = m_EventStore.begin(); itr != m_EventStore.end(); ++itr)
{
CalendarEvent* event = &itr->second;
if (event->IsGuildAnnouncement())
continue;
CalendarInviteMap const* cInvMap = event->GetInviteMap();
CalendarInviteMap::const_iterator ci_itr = cInvMap->begin();
while (ci_itr != cInvMap->end())
{
if (ci_itr->second->InviteeGuid == guid)
{
calInvList.push_back(ci_itr->second);
break;
}
++ci_itr;
}
}
}
示例3: CanAddInviteTo
// check if an invitee have not reached invite limit
bool CalendarMgr::CanAddInviteTo(ObjectGuid const& guid)
{
uint32 totalInvites = 0;
for (CalendarEventStore::iterator itr = m_EventStore.begin(); itr != m_EventStore.end(); ++itr)
{
CalendarEvent* event = &itr->second;
if (event->IsGuildAnnouncement())
continue;
CalendarInviteMap const* cInvMap = event->GetInviteMap();
CalendarInviteMap::const_iterator ci_itr = cInvMap->begin();
while (ci_itr != cInvMap->end())
{
if ((ci_itr->second->InviteeGuid == guid) && (++totalInvites >= CALENDAR_MAX_INVITES))
return false;
++ci_itr;
}
}
return true;
}