本文整理汇总了C++中ManagedReference::dropObserver方法的典型用法代码示例。如果您正苦于以下问题:C++ ManagedReference::dropObserver方法的具体用法?C++ ManagedReference::dropObserver怎么用?C++ ManagedReference::dropObserver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ManagedReference
的用法示例。
在下文中一共展示了ManagedReference::dropObserver方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stopDancing
void EntertainingSessionImplementation::stopDancing() {
ManagedReference<CreatureObject*> entertainer = this->entertainer.get();
if (entertainer == NULL)
return;
Locker locker(entertainer);
if (!dancing)
return;
dancing = false;
entertainer->sendSystemMessage("@performance:dance_stop_self");
performanceName = "";
sendEntertainingUpdate(entertainer, 0.8025000095f, entertainer->getPerformanceAnimation(), 0, 0);
if (entertainer->getPosture() == CreaturePosture::SKILLANIMATING)
entertainer->setPosture(CreaturePosture::UPRIGHT);
ManagedReference<PlayerManager*> playerManager = entertainer->getZoneServer()->getPlayerManager();
while (watchers.size() > 0) {
ManagedReference<CreatureObject*> watcher = watchers.elementAt(0).getKey();
Locker clocker(watcher, entertainer);
playerManager->stopWatch(watcher, entertainer->getObjectID(), true, true, false);
if (!watcher->isWatching())
sendEntertainmentUpdate(watcher, 0, "", true);
watchers.drop(watcher);
}
if (tickTask != NULL && tickTask->isScheduled())
tickTask->cancel();
updateEntertainerMissionStatus(false, MissionObject::DANCER);
entertainer->notifyObservers(ObserverEventType::STOPENTERTAIN, entertainer);
entertainer->dropObserver(ObserverEventType::POSTURECHANGED, observer);
if (!dancing && !playingMusic) {
ManagedReference<PlayerObject*> entPlayer = entertainer->getPlayerObject();
if (entPlayer != NULL && entPlayer->getPerformanceBuffTarget() != 0)
entPlayer->setPerformanceBuffTarget(0);
entertainer->dropActiveSession(SessionFacadeType::ENTERTAINING);
}
}
示例2: cancelSession
int ImageDesignSessionImplementation::cancelSession() {
ManagedReference<CreatureObject*> designerCreature = this->designerCreature.get();
ManagedReference<CreatureObject*> targetCreature = this->targetCreature.get();
if (designerCreature != NULL) {
designerCreature->dropActiveSession(SessionFacadeType::IMAGEDESIGN);
if (positionObserver != NULL)
designerCreature->dropObserver(ObserverEventType::POSITIONCHANGED, positionObserver);
}
if (targetCreature != NULL) {
targetCreature->dropActiveSession(SessionFacadeType::IMAGEDESIGN);
if (positionObserver != NULL)
targetCreature->dropObserver(ObserverEventType::POSITIONCHANGED, positionObserver);
}
dequeueIdTimeoutEvent();
return 0;
}
示例3: abort
void SurveyMissionObjectiveImplementation::abort() {
MissionObjectiveImplementation::abort();
if (!hasObservers())
return;
ManagedReference<MissionObserver*> observer = getObserver(0);
ManagedReference<CreatureObject*> player = getPlayerOwner();
if (player != NULL) {
player->dropObserver(ObserverEventType::SURVEY, observer);
dropObserver(observer, true);
}
}
示例4: abort
void HuntingMissionObjectiveImplementation::abort() {
MissionObjectiveImplementation::abort();
for (int i = 0; i < getObserverCount(); i++) {
ManagedReference<MissionObserver*> observer = getObserver(i);
ManagedReference<CreatureObject*> player = getPlayerOwner();
if (player != NULL) {
Locker locker(player);
player->dropObserver(ObserverEventType::KILLEDCREATURE, observer);
dropObserver(observer, true);
}
}
}
示例5: stopPlayingMusic
void EntertainingSessionImplementation::stopPlayingMusic() {
ManagedReference<CreatureObject*> entertainer = this->entertainer.get();
Locker locker(entertainer);
if (!playingMusic)
return;
playingMusic = false;
entertainer->sendSystemMessage("@performance:music_stop_self");
sendEntertainingUpdate(entertainer, 0.8025000095f, entertainer->getPerformanceAnimation(), 0, 0);
performanceName = "";
entertainer->setListenToID(0);
if (entertainer->getPosture() == CreaturePosture::SKILLANIMATING)
entertainer->setPosture(CreaturePosture::UPRIGHT);
if (externalInstrument != NULL && externalInstrument->isBeingUsed())
externalInstrument->setBeingUsed(false);
externalInstrument = NULL;
ManagedReference<PlayerManager*> playerManager = entertainer->getZoneServer()->getPlayerManager();
while (listeners.size() > 0) {
ManagedReference<CreatureObject*> listener = listeners.elementAt(0).getKey();
Locker clocker(listener, entertainer);
playerManager->stopListen(listener, entertainer->getObjectID(), true, true, false);
if (!listener->isWatching())
sendEntertainmentUpdate(listener, 0, "", true);
listeners.drop(listener);
}
if (tickTask != NULL && tickTask->isScheduled())
tickTask->cancel();
targetInstrument = false;
updateEntertainerMissionStatus(false, MissionObject::MUSICIAN);
entertainer->notifyObservers(ObserverEventType::STOPENTERTAIN, entertainer);
entertainer->dropObserver(ObserverEventType::POSTURECHANGED, observer);
ManagedReference<GroupObject*> group = entertainer->getGroup();
if (group != NULL) {
bool otherPlaying = group->isOtherMemberPlayingMusic(entertainer);
if (!otherPlaying) {
Locker locker(group);
group->setBandSong("");
}
}
if (!dancing && !playingMusic) {
ManagedReference<PlayerObject*> entPlayer = entertainer->getPlayerObject();
if (entPlayer != NULL && entPlayer->getPerformanceBuffTarget() != 0)
entPlayer->setPerformanceBuffTarget(0);
entertainer->dropActiveSession(SessionFacadeType::ENTERTAINING);
}
}