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


C++ CreatureObject::isInvisible方法代码示例

本文整理汇总了C++中CreatureObject::isInvisible方法的典型用法代码示例。如果您正苦于以下问题:C++ CreatureObject::isInvisible方法的具体用法?C++ CreatureObject::isInvisible怎么用?C++ CreatureObject::isInvisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CreatureObject的用法示例。


在下文中一共展示了CreatureObject::isInvisible方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getPlayersInRange

int LuaSceneObject::getPlayersInRange(lua_State *L) {
    int range = lua_tonumber(L, -1);

    Zone* thisZone = realObject->getZone();

    if (thisZone == NULL) {
        lua_pushnil(L);
        return 1;
    }

    lua_newtable(L);

    Reference<SortedVector<ManagedReference<QuadTreeEntry*> >*> closeObjects = new SortedVector<ManagedReference<QuadTreeEntry*> >();
    thisZone->getInRangeObjects(realObject->getWorldPositionX(), realObject->getWorldPositionY(), range, closeObjects, true);
    int numPlayers = 0;

    for (int i = 0; i < closeObjects->size(); ++i) {
        SceneObject* object = cast<SceneObject*>(closeObjects->get(i).get());

        if (object == NULL || !object->isPlayerCreature())
            continue;

        CreatureObject* player = object->asCreatureObject();

        if (player == NULL || player->isInvisible())
            continue;

        numPlayers++;
        lua_pushlightuserdata(L, object);
        lua_rawseti(L, -2, numPlayers);
    }

    return 1;
}
开发者ID:ModTheGalaxy,项目名称:mtgserver,代码行数:34,代码来源:LuaSceneObject.cpp

示例2: notifyEnter

void SpawnAreaImplementation::notifyEnter(SceneObject* object) {
    if (!(tier & SpawnAreaMap::SPAWNAREA)) {
        ActiveAreaImplementation::notifyEnter(object);
        return;
    }

    if (!object->isPlayerCreature())
        return;

    CreatureObject* creo = cast<CreatureObject*>(object);
    if (creo->isInvisible()) {
        return;
    }

    ManagedReference<SceneObject*> parent = object->getParent();

    if (parent != NULL && parent->isCellObject())
        return;

    if (object->getCityRegion() != NULL)
        return;

    ManagedReference<SpawnArea*> spawnArea = _this.getReferenceUnsafeStaticCast();
    ManagedReference<SceneObject*> obj = object;

    EXECUTE_TASK_2(spawnArea, obj, {
            spawnArea_p->tryToSpawn(obj_p);
    });
开发者ID:Stee7l,项目名称:legend-of-hondo,代码行数:28,代码来源:SpawnAreaImplementation.cpp

示例3: notifyInsert

void PlayerZoneComponent::notifyInsert(SceneObject* sceneObject, QuadTreeEntry* entry) {
    SceneObject* scno = cast<SceneObject*>( entry);

    if (scno == NULL || scno == sceneObject)
        return;

    if (scno->isPlayerCreature()) {
        CreatureObject* player = cast<CreatureObject*>( scno);

        if (player->isInvisible())
            return;
    }

    ManagedReference<SceneObject*> parent = scno->getParent().get();

    if (parent != NULL /*&& parent->isCellObject()*/) {
        return;
    }

    scno->sendTo(sceneObject, true);
}
开发者ID:blacknightownzjoo,项目名称:SWGOOW,代码行数:21,代码来源:PlayerZoneComponent.cpp

示例4: updateZoneWithParent

void ZoneComponent::updateZoneWithParent(SceneObject* sceneObject, SceneObject* newParent, bool lightUpdate, bool sendPackets) {
    ManagedReference<Zone*> zone = sceneObject->getZone();
    ManagedReference<SceneObject*> oldParent = sceneObject->getParent();

    if (oldParent != NULL && !oldParent->isCellObject())
        return;

    if (zone == NULL)
        zone = newParent->getRootParent().get()->getZone();

    Locker _locker(zone);

    if (oldParent == NULL) { // we are in zone, enter cell
        //zone->remove(sceneObject);

        newParent->transferObject(sceneObject, -1, true);

        zone->unlock();
        //insertToBuilding(sceneObject, dynamic_cast<BuildingObject*>(newParent->getParent()));
    } else { // we are in cell already
        if (oldParent != newParent) {
            //oldParent->removeObject(sceneObject, false);
            newParent->transferObject(sceneObject, -1, true);

            zone->unlock();
        } else {
            zone->unlock();

            zone->updateActiveAreas(sceneObject);
        }

        //notify in range objects that i moved
    }

    CloseObjectsVector* closeObjects = (CloseObjectsVector*) sceneObject->getCloseObjects();

    if (closeObjects != NULL) {
        SortedVector<ManagedReference<QuadTreeEntry*> > objects(closeObjects->size(), 10);
        closeObjects->safeCopyTo(objects);

        for (int i = 0; i < objects.size(); ++i) {
            QuadTreeEntry* object = objects.get(i);
            try {
                object->notifyPositionUpdate(sceneObject);
            } catch (Exception& e) {

            }
        }
    }

    //zoneLocker.release();

    //zone->unlock();

    bool isInvis = false;

    if (sceneObject->isCreatureObject()) {
        CreatureObject* creo = cast<CreatureObject*>(sceneObject);
        if(creo->isInvisible())
            isInvis = true;
    }

    if (sendPackets && !isInvis) {
        if (lightUpdate) {
            LightUpdateTransformWithParentMessage* message = new LightUpdateTransformWithParentMessage(sceneObject);
            sceneObject->broadcastMessage(message, false, true);
        } else {
            UpdateTransformWithParentMessage* message = new UpdateTransformWithParentMessage(sceneObject);
            sceneObject->broadcastMessage(message, false, true);
        }
    }

    try {
        notifySelfPositionUpdate(sceneObject);
    } catch (Exception& e) {
        sceneObject->error("Exception caught while calling notifySelfPositionUpdate(sceneObject) in ZoneComponent::updateZoneWithParent");
        sceneObject->error(e.getMessage());
    }

    zone->wlock();
}
开发者ID:dogg-jr,项目名称:GR-Core,代码行数:81,代码来源:ZoneComponent.cpp

示例5: updateZone

void ZoneComponent::updateZone(SceneObject* sceneObject, bool lightUpdate, bool sendPackets) {
    ManagedReference<SceneObject*> parent = sceneObject->getParent();
    Zone* zone = sceneObject->getZone();
    ManagedReference<SceneObject*> sceneObjectRootParent = sceneObject->getRootParent();

    if (zone == NULL) {
        if (sceneObjectRootParent == NULL)
            return;

        zone = sceneObjectRootParent->getZone();
    }

    if (parent != NULL && (parent->isVehicleObject() || parent->isMount()))
        sceneObject->updateVehiclePosition(sendPackets);

    Locker _locker(zone);

    bool zoneUnlocked = false;

    if (parent != NULL && parent->isCellObject()) {
        //parent->removeObject(sceneObject, true);
        //removeFromBuilding(sceneObject, dynamic_cast<BuildingObject*>(parent->getParent()));

        zone = parent->getRootParent().get()->getZone();

        zone->transferObject(sceneObject, -1, false);

        zone->unlock();
    } else {
        if (sceneObject->getLocalZone() != NULL) {
            zone->update(sceneObject);

            zone->unlock();

            zone->inRange(sceneObject, 192);
        } else if (parent != NULL) {
            zone->unlock();

            updateInRangeObjectsOnMount(sceneObject);
        }
    }

    zone->updateActiveAreas(sceneObject);
    
    bool isInvis = false;

    if (sceneObject->isCreatureObject()) {
        CreatureObject* creo = cast<CreatureObject*>(sceneObject);
        
        if(creo->isInvisible())
            isInvis = true;
        }


    if (!isInvis && sendPackets && (parent == NULL || (!parent->isVehicleObject() && !parent->isMount()))) {
        if (lightUpdate) {
            LightUpdateTransformMessage* message = new LightUpdateTransformMessage(sceneObject);
            sceneObject->broadcastMessage(message, false, true);
        } else {
            UpdateTransformMessage* message = new UpdateTransformMessage(sceneObject);
            sceneObject->broadcastMessage(message, false, true);
        }
    }

    try {
        notifySelfPositionUpdate(sceneObject);
    } catch (Exception& e) {
        sceneObject->error("Exception caught while calling notifySelfPositionUpdate(sceneObject) in ZoneComponent::updateZone");
        sceneObject->error(e.getMessage());
    }

    zone->wlock();
}
开发者ID:dogg-jr,项目名称:GR-Core,代码行数:73,代码来源:ZoneComponent.cpp


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