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


C++ CInstance类代码示例

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


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

示例1: visit

		virtual void visit(CInstance &inst)
		{
			if (inst.getDisplayerVisual())
			{
				inst.getDisplayerVisual()->updateWorldPos();
			}
		}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:7,代码来源:displayer_visual.cpp

示例2: getGroupingCandidate

//***************************************************************
void CAutoGroup::update(const CVector &testPos, const std::string &paletteEntry, bool valid)
{
	//H_AUTO(R2_CAutoGroup_update)
	_TestPos = testPos;
	_PaletteEntry = paletteEntry;
	_AutoGroupEnabled = valid;
	CInstance *candidate = getGroupingCandidate();
	if (!candidate && _AutoGroup.isAddedToWorldMap())
	{
		clear();
	}
	else if (candidate)
	{
		// update the display
		if (!_AutoGroup.isAddedToWorldMap())
		{
			CGroupMap *gm = CTool::getWorldMap();
			if (gm)
			{
				gm->addDeco(&_AutoGroup);
			}
		}
		CDisplayerVisual *dv = candidate->getDisplayerVisual();
		nlassert(dv); // should not be null because getGrou^pingCandidate succeeded
		_PrimRenderVertices.resize(2);
		CVector pos = dv->isCompound() ? dv->getSon(0)->getWorldPos() : dv->getWorldPos();
		_PrimRenderVertices[0] = pos;
		_PrimRenderVertices[1] = _TestPos;
		_AutoGroup.setVertices(_PrimRenderVertices);
		_AutoGroup.addDecalsToRenderList();
	}
}
开发者ID:mixxit,项目名称:solinia,代码行数:33,代码来源:auto_group.cpp

示例3: cancelAction

// ***************************************************************
void CToolSelectRotate::cancelAction(CInstance &instance)
{
	//H_AUTO(R2_CToolSelectRotate_cancelAction)
	CEntityCL *entity = instance.getEntity();
	nlassert(entity);
	getEditor().requestRollbackLocalNode(instance.getId(), "Angle");
	setRotateInProgress(false, instance);
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:9,代码来源:tool_select_rotate.cpp

示例4: commitAction

// ***************************************************************
void CToolSelectRotate::commitAction(CInstance &instance)
{
	//H_AUTO(R2_CToolSelectRotate_commitAction)
	getDMC().newAction(CI18N::get("uiR2EDRotateAction") + instance.getDisplayName());
	// nothing to do, entity already has good angle
	getEditor().requestCommitLocalNode(instance.getId(), "Angle");
	setRotateInProgress(false, instance);
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:9,代码来源:tool_select_rotate.cpp

示例5: checkMonsterInList

bool CInstanceHandler::checkMonsterInList(CMobEntity* PMob)
{
    CInstance* PInstance = m_Instances[0];

    if(PInstance->isMonsterInList(PMob))
        return true;
    else
        return false;
}
开发者ID:kidaa,项目名称:ffxinfinity,代码行数:9,代码来源:instance_handler.cpp

示例6: dynamisMessage

int CInstanceHandler::dynamisMessage(uint16 Param1, uint16 Param2) {

    CInstance* PInstance = m_Instances[0];

    PInstance->addTimeLimit(Param2*60);
    PInstance->pushMessageToAllInBcnm(Param1,Param2);

    return 1;
}
开发者ID:kidaa,项目名称:ffxinfinity,代码行数:9,代码来源:instance_handler.cpp

示例7: convertValueToNPVariant

// Variant value must be released with NPReleaseVariantValue()
void convertValueToNPVariant (KJS::ExecState *exec, const KJS::Value &value, NPVariant *result)
{
    Type type = value.type();

    if (type == StringType) {
        UString ustring = value.toString(exec);
        CString cstring = ustring.UTF8String();
        NPString string = { (const NPUTF8 *)cstring.c_str(), cstring.size() };
        NPN_InitializeVariantWithStringCopy (result, &string );
    }
    else if (type == NumberType) {
        NPN_InitializeVariantWithDouble (result, value.toNumber(exec));
    }
    else if (type == BooleanType) {
        NPN_InitializeVariantWithBool (result, value.toBoolean(exec));
    }
    else if (type == UnspecifiedType) {
        NPN_InitializeVariantAsUndefined(result);
    }
    else if (type == NullType) {
        NPN_InitializeVariantAsNull(result);
    }
    else if (type == ObjectType) {
        KJS::ObjectImp *objectImp = static_cast<KJS::ObjectImp*>(value.imp());
        if (objectImp->classInfo() == &KJS::RuntimeObjectImp::info) {
            KJS::RuntimeObjectImp *imp = static_cast<KJS::RuntimeObjectImp *>(value.imp());
            CInstance *instance = static_cast<CInstance*>(imp->getInternalInstance());
            NPN_InitializeVariantWithObject (result, instance->getObject());
        }
        else {

            KJS::Interpreter *originInterpreter = exec->interpreter();
            const Bindings::RootObject *originExecutionContext = rootForInterpreter(originInterpreter);

            KJS::Interpreter *interpreter = 0;
            if (originInterpreter->isGlobalObject(value)) {
                interpreter = originInterpreter->interpreterForGlobalObject (value.imp());
            }

            if (!interpreter)
                interpreter = originInterpreter;

            const Bindings::RootObject *executionContext = rootForInterpreter(interpreter);
            if (!executionContext) {
                Bindings::RootObject *newExecutionContext = new KJS::Bindings::RootObject(0);
                newExecutionContext->setInterpreter (interpreter);
                executionContext = newExecutionContext;
            }

            NPObject *obj = (NPObject *)exec->interpreter()->createLanguageInstanceForValue (exec, Instance::CLanguage, value.toObject(exec), originExecutionContext, executionContext);
            NPN_InitializeVariantWithObject (result, obj);
            _NPN_ReleaseObject (obj);
        }
    }
    else
        NPN_InitializeVariantAsUndefined(result);
}
开发者ID:BackupTheBerlios,项目名称:wxwebcore-svn,代码行数:58,代码来源:c_utility.cpp

示例8: insertMonsterInList

void CInstanceHandler::insertMonsterInList(CMobEntity* PMob)
{
    CInstance* PInstance = m_Instances[0];

    if(PInstance->isMonsterInList(PMob) == false)
    {
        PInstance->addMonsterInList(PMob);
    }
}
开发者ID:kidaa,项目名称:ffxinfinity,代码行数:9,代码来源:instance_handler.cpp

示例9: openTreasureChest

void CInstanceHandler::openTreasureChest(CCharEntity* PChar) {
    for(int i=0; i<m_MaxInstances; i++) {
        if(m_Instances[i] != NULL) {
            if(m_Instances[i]->isValidPlayerForBcnm(PChar)) {
                CInstance* PInstance = m_Instances[i];
                PInstance->OpenChestinBcnm();
            }
        }
    }
}
开发者ID:kidaa,项目名称:ffxinfinity,代码行数:10,代码来源:instance_handler.cpp

示例10: getMousePos

// **********************************************
void CToolPick::updateAfterRender()
{
	//H_AUTO(R2_CToolPick_updateAfterRender)
	// See if the mouse is over a valid position
	_ValidPos = false;
	sint32 mouseX,  mouseY;
	getMousePos(mouseX,  mouseY);
	if (!isInScreen(mouseX,  mouseY))
	{
		getEditor().setFocusedInstance(NULL);
		setMouseCursor(_CursCannotPickPos);
		return;
	}
	_CandidateInstance = NULL;
	CInstance *instanceUnder = checkInstanceUnderMouse();
	bool ignoreInstanceUnder = false;
	if(instanceUnder && _IgnoreInstances.size()>0)
	{
		for(uint i=0; i<_IgnoreInstances.size(); i++)
		{
			if(instanceUnder->isKindOf(_IgnoreInstances[i]))
			{
				ignoreInstanceUnder = true;
				break;
			}
		}
	}
	if (!instanceUnder || ignoreInstanceUnder)
	{
		if (isMouseOnUI() && !isMouseOnContainer())
		{
			setMouseCursor(DEFAULT_CURSOR);
		}
		else
		{
			CTool::CWorldViewRay worldViewRay;
			computeWorldViewRay(mouseX,  mouseY,  worldViewRay);
			CVector inter;
			_ValidPos = (ValidPacsPos == computeLandscapeRayIntersection(worldViewRay,  _Intersection));
			setMouseCursor(_ValidPos ? _CursCanPickPos : _CursCannotPickPos);
			getEditor().setFocusedInstance(NULL);
		}
		return;
	}
	getEditor().setFocusedInstance(instanceUnder);
	if (canPick(*instanceUnder))
	{
		_CandidateInstance = instanceUnder;
		setMouseCursor(_CursCanPickInstance);
	}
	else
	{
		setMouseCursor(_CursCannotPickInstance);
	}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:56,代码来源:tool_pick.cpp

示例11: getDisplayedInstance

//*********************************************************************************************************
CDisplayerVisual *CDisplayerVisualActivitySequence::getParentDV() const
{
	//H_AUTO(R2_CDisplayerVisualActivitySequence_getParentDV)
	CInstance *currParent = getDisplayedInstance()->getParent();
	CDisplayerVisual *prevDV = NULL;
	while (currParent)
	{
		prevDV = currParent->getDisplayerVisual();
		if (prevDV) break;
		currParent = currParent->getParent();
	}
	return prevDV;
}
开发者ID:mixxit,项目名称:solinia,代码行数:14,代码来源:displayer_visual_activity_sequence.cpp

示例12: convertValueToNPVariant

// Variant value must be released with NPReleaseVariantValue()
void convertValueToNPVariant(ExecState *exec, JSValue *value, NPVariant *result)
{
    JSLock lock;
    
    JSType type = value->type();
    
    VOID_TO_NPVARIANT(*result);

    if (type == StringType) {
        UString ustring = value->toString(exec);
        CString cstring = ustring.UTF8String();
        NPString string = { (const NPUTF8 *)cstring.c_str(), static_cast<uint32_t>(cstring.size()) };
        NPN_InitializeVariantWithStringCopy(result, &string);
    } else if (type == NumberType) {
        DOUBLE_TO_NPVARIANT(value->toNumber(exec), *result);
    } else if (type == BooleanType) {
        BOOLEAN_TO_NPVARIANT(value->toBoolean(exec), *result);
    } else if (type == UnspecifiedType) {
        VOID_TO_NPVARIANT(*result);
    } else if (type == NullType) {
        NULL_TO_NPVARIANT(*result);
    } else if (type == ObjectType) {
        JSObject* object = static_cast<JSObject*>(value);
        if (object->classInfo() == &RuntimeObjectImp::info) {
            RuntimeObjectImp* imp = static_cast<RuntimeObjectImp *>(value);
            CInstance* instance = static_cast<CInstance*>(imp->getInternalInstance());
            if (instance) {
                NPObject* obj = instance->getObject();
                _NPN_RetainObject(obj);
                OBJECT_TO_NPVARIANT(obj, *result);
            }
        } else {
            Interpreter* originInterpreter = exec->dynamicInterpreter();
            RootObject* originRootObject = findRootObject(originInterpreter);

            Interpreter* interpreter = 0;
            if (originInterpreter->isGlobalObject(value)) {
                interpreter = originInterpreter->interpreterForGlobalObject(value);
            }

            if (!interpreter)
                interpreter = originInterpreter;

            RootObject* rootObject = findRootObject(interpreter);
            if (rootObject) {
                NPObject* npObject = _NPN_CreateScriptObject(0, object, originRootObject, rootObject);
                OBJECT_TO_NPVARIANT(npObject, *result);
            }
        }
    }
}
开发者ID:dfizban,项目名称:remixos-usb-tool,代码行数:52,代码来源:c_utility.cpp

示例13: DecreaseZoneCounter

void CZoneInstance::DecreaseZoneCounter(CCharEntity* PChar)
{
	CInstance* instance = PChar->PInstance;

	if (instance)
	{
		instance->DecreaseZoneCounter(PChar);
		instance->DespawnPC(PChar);
		CharZoneOut(PChar);
        PChar->StatusEffectContainer->DelStatusEffectSilent(EFFECT_LEVEL_RESTRICTION);
		PChar->PInstance = nullptr;

		if (instance->CharListEmpty())
		{
			if (instance->Failed() || instance->Completed())
			{
				instanceList.erase(std::find(instanceList.begin(), instanceList.end(), instance));
				delete instance;
			}
			else
			{
				instance->SetWipeTime(instance->GetElapsedTime(gettick()));
			}
		}
	}
}
开发者ID:DomingoSeven,项目名称:darkstar,代码行数:26,代码来源:zone_instance.cpp

示例14: registerDynamis

int CInstanceHandler::registerDynamis(uint16 id, CCharEntity* PChar) {
    if(!hasFreeInstance()) {
        return -1;
    }
    CInstance* PInstance = instanceutils::loadInstance(this,id);
    if(PInstance==NULL) {
        return -1;
    }
    for(int i=0; i<m_MaxInstances; i++) {
        if(m_Instances[i]==NULL) {
            PInstance->setInstanceNumber(i+1);
            break;
        }
    }

    if(PInstance->addPlayerToDynamis(PChar)) {
        ShowDebug("InstanceHandler ::1 Added %s to the valid players list for Dynamis %i Instance %i \n",
                  PChar->GetName(),id,PInstance->getInstanceNumber());
    }

    m_Instances[PInstance->getInstanceNumber()-1] = PInstance;
    PInstance->init();
    PInstance->setDynaUniqueID();
    luautils::OnBcnmRegister(PChar,PInstance);
    return PInstance->getInstanceNumber();
}
开发者ID:kidaa,项目名称:ffxinfinity,代码行数:26,代码来源:instance_handler.cpp

示例15: DecreaseZoneCounter

void CZoneInstance::DecreaseZoneCounter(CCharEntity* PChar)
{
	CInstance* instance = PChar->PInstance;

	if (instance)
	{
		instance->DecreaseZoneCounter(PChar);
		instance->DespawnPC(PChar);
		CharZoneOut(PChar);
		PChar->PInstance = NULL;

		if (instance->CharListEmpty())
		{
			if (instance->Failed() || instance->Completed())
			{
				instanceList.erase(std::find(instanceList.begin(), instanceList.end(), instance));
				delete instance;
			}
			else
			{
				instance->SetWipeTime(instance->GetElapsedTime(gettick()));
			}
		}
	}
}
开发者ID:Annihilus343,项目名称:darkstar,代码行数:25,代码来源:zone_instance.cpp


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