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


C++ ExtractArgs函数代码示例

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


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

示例1: Cmd_GetClassSkills_Execute

static bool Cmd_GetClassSkills_Execute(COMMAND_ARGS)
{
    ArrayID arr = g_ArrayMap.Create(kDataType_Numeric, true, scriptObj->GetModIndex());
    *result = arr;

    TESClass* theClass = NULL;
    if (ExtractArgs(PASS_EXTRACT_ARGS, &theClass))
    {
        if (!theClass && thisObj)
        {
            TESNPC* npc = OBLIVION_CAST(thisObj->baseForm, TESForm, TESNPC);
            theClass = npc ? npc->npcClass : NULL;
        }

        if (theClass)
        {
            for (UInt32 idx = 0; idx < 7; idx++)
            {
                g_ArrayMap.SetElementNumber(arr, idx, theClass->majorSkills[idx]);
            }
        }
    }

    return true;
}
开发者ID:nh2,项目名称:obse,代码行数:25,代码来源:Commands_Class.cpp

示例2: Cmd_GetCreatureModelPaths_Execute

static bool Cmd_GetCreatureModelPaths_Execute(COMMAND_ARGS)
{
	UInt32 arrID = g_ArrayMap.Create(kDataType_Numeric, true, scriptObj->GetModIndex());
	*result = arrID;

	TESActorBase* actorBase = NULL;

	if (ExtractArgs(PASS_EXTRACT_ARGS, &actorBase))
	{
		if (!actorBase && thisObj)
			actorBase = OBLIVION_CAST(thisObj->baseForm, TESForm, TESActorBase);

		if (actorBase)
		{
			TESCreature* crea = OBLIVION_CAST(actorBase, TESActorBase, TESCreature);
			if (crea)
			{
				UInt32 idx = 0;
				for (TESModelList::Entry* cur = &crea->modelList.modelList; cur && cur->nifPath; cur = cur->next)
				{
					g_ArrayMap.SetElementString(arrID, ArrayKey(idx), cur->nifPath);
					idx++;
				}
			}
		}
	}

	return true;
}
开发者ID:nh2,项目名称:obse,代码行数:29,代码来源:Commands_Creature.cpp

示例3: Cmd_GetCellResetHours_Execute

static bool Cmd_GetCellResetHours_Execute(COMMAND_ARGS)
{
	*result = -1;
	TESObjectCELL* cell = NULL;
	if (ExtractArgs(PASS_EXTRACT_ARGS, &cell) && cell)
	{
		SInt32 iHoursToRespawn = TimeGlobals::HoursToRespawnCell();
		SInt32 iHoursPassed = TimeGlobals::GameHoursPassed();

		ExtraDetachTime* xDetach = (ExtraDetachTime*)cell->extraData.GetByType(kExtraData_DetachTime);
		if (xDetach)
		{
			SInt32 detachTime = xDetach->detachTime;
			if (xDetach->detachTime == 0xFFFFFFFF)		// ResetInterior sets it to this for immediate respawn
				*result = 0;
			else
			{
				detachTime += iHoursToRespawn;
				if (detachTime <= iHoursPassed)
					*result = 0;
				else
					*result = detachTime - iHoursPassed;
			}
		}
	}

	return true;
}
开发者ID:neomonkeus,项目名称:Oblivion-Script-Extender,代码行数:28,代码来源:Commands_Cell.cpp

示例4: Cmd_SetPackageTargetReference_Execute

bool Cmd_SetPackageTargetReference_Execute(COMMAND_ARGS)
{
	*result = 0;

	//DEBUG_MESSAGE("\t\tSPT @\n");
	TESObjectREFR* pRefr = NULL;
	TESForm * pForm = NULL;
	TESPackage* pPackage = NULL;
	ExtractArgs(EXTRACT_ARGS, &pForm, &pRefr);
	if (!pRefr)
		if(!thisObj)
			return true;
		else
			pRefr = thisObj;
	//DEBUG_MESSAGE("\t\tSPT 0 Refr:[%08X]\n", pRefr->refID);
	if (!pForm)
			return true;
	//DEBUG_MESSAGE("\t\tSPT 1 Form:0x%x Refr:[%08X]\n", pForm, pRefr->refID);
	pPackage = DYNAMIC_CAST(pForm, TESForm, TESPackage);
	//DEBUG_MESSAGE("\t\tSPT 2 Package:0x%x Refr:[%08X]\n", pPackage, pRefr->refID);
	if (pPackage) {
		//if (pPackage->target)
		//	DEBUG_MESSAGE("target is %s", pPackage->target->StringForTargetCodeAndData());
		//DEBUG_MESSAGE("\t\tSPT 3 Package:[%08X] Refr:[%08X] Target:0x%x\n", pPackage->refID, pRefr->refID, pPackage->target);
		pPackage->SetTarget(pRefr);
		//DEBUG_MESSAGE("\t\tSPT 4 Package:[%08X] Refr:[%08X] Target:0x%x\n", pPackage->refID, pRefr->refID, pPackage->target);
		//if (pPackage->target)
		//	DEBUG_MESSAGE("target is %s", pPackage->target->StringForTargetCodeAndData());
	}
	return true;
}
开发者ID:Alenett,项目名称:TES-Reloaded-Source,代码行数:31,代码来源:Commands_Packages.cpp

示例5: Cmd_RemovePackageAt_Execute

bool Cmd_RemovePackageAt_Execute(COMMAND_ARGS)
{
	*result = 0;
	UInt32* refResult = (UInt32*)result;
	TESObjectREFR* pRefr = NULL;
	TESAIForm* pAI = NULL;
	TESPackage* pPackage = NULL;
	SInt32 anIndex = 0;

	ExtractArgs(EXTRACT_ARGS, &anIndex, &pRefr);
	if (!pRefr)
		if(!thisObj)
			return true;
		else
			pRefr = thisObj;

	//DEBUG_MESSAGE("\t\tRPA 0 Actor:%x index:[%d] package:[%010x]\n", pRefr->refID, anIndex, *result);
	Actor* pActor = DYNAMIC_CAST(pRefr, TESForm, Actor);
	if (pActor)
		pAI = DYNAMIC_CAST(pActor->baseForm, TESForm, TESAIForm);
	if (pAI)
		pPackage = pAI->RemovePackageAt(anIndex);
	if (pPackage)
		*refResult = pPackage->refID;
	//DEBUG_MESSAGE("\t\tRPA 1 Actor:%x index:[%d] package:[%010x]\n", pRefr->refID, anIndex, *result);
	return true;
}
开发者ID:Alenett,项目名称:TES-Reloaded-Source,代码行数:27,代码来源:Commands_Packages.cpp

示例6: Cmd_GetCurrentPackage_Execute

bool Cmd_GetCurrentPackage_Execute(COMMAND_ARGS)
{
	*result = 0;
	UInt32* refResult = (UInt32*)result;
	*refResult = 0;

	//DEBUG_MESSAGE("\t\tGCP @\n");
	TESObjectREFR* pRefr = NULL;
	Actor * pActor = NULL;
	TESPackage* pPackage = NULL;
	ExtractArgs(EXTRACT_ARGS, &pRefr);
	if (!pRefr)
		if(!thisObj)
			return true;
		else
			pRefr = thisObj;
	//DEBUG_MESSAGE("\t\tGCP 0 Refr:%x\n", pRefr->refID);
	pActor = DYNAMIC_CAST(pRefr, TESObjectREFR, Actor);
	if (!pActor || !pActor->baseProcess)
			return true;
	//DEBUG_MESSAGE("\t\tGCP 1 Package:[%x] Refr:%x\n", pForm, pRefr->refID);
	pPackage = pActor->baseProcess->GetCurrentPackage();
	//DEBUG_MESSAGE("\t\tGCP 2 Package:[%x] Refr:%x\n", pPackage, pRefr->refID);
	if (pPackage) {
		*refResult = pPackage->refID;
		//DEBUG_MESSAGE("\t\tGCP 3 Package:%x  Refr:%x\n", *refResult, pRefr->refID);
	}
	if (IsConsoleMode())
		Console_Print("GetCurrentPackage >> [%08X] ", *result);
	return true;
}
开发者ID:Alenett,项目名称:TES-Reloaded-Source,代码行数:31,代码来源:Commands_Packages.cpp

示例7: Cmd_GetPackageLocation_Execute

bool Cmd_GetPackageLocation_Execute(COMMAND_ARGS)
{
	*result = 0;
	UInt32* refResult = (UInt32*)result;
	*refResult = 0;

	//DEBUG_MESSAGE("\t\tSPL @\n");
	TESForm * pForm = NULL;
	TESPackage* pPackage = NULL;
	ExtractArgs(EXTRACT_ARGS, &pForm);
	if (!pForm)
		return true;
	//DEBUG_MESSAGE("\t\tGPL 1 Package:[%x]\n", pForm);
	pPackage = DYNAMIC_CAST(pForm, TESForm, TESPackage);
	//DEBUG_MESSAGE("\t\tGPL 2 Package:[%x]\n", pPackage);
	if (pPackage && pPackage->location) {
		//DEBUG_MESSAGE("\t\tGPL 3 Package:%x\n", pPackage->refID);
		TESPackage::LocationData * pLocation = pPackage->GetLocationData();
		//DEBUG_MESSAGE("\t\GSPL 4 Package:%x Location:[%x]\n", pPackage->refID, pLocation);
		if (pLocation && pLocation->object.form)
			switch (pLocation->locationType) {
				case TESPackage::LocationData::kPackLocation_NearReference:
				case TESPackage::LocationData::kPackLocation_InCell:
				case TESPackage::LocationData::kPackLocation_ObjectID:
					*refResult = pLocation->object.form->refID;
					break;
				case TESPackage::LocationData::kPackLocation_ObjectType:
					*refResult = pLocation->object.objectCode;
					break;
		}

			//DEBUG_MESSAGE("\t\tSPL 5 Package:%x Location:[%x]\n", pPackage->refID, *refResult);
	}
	return true;
}
开发者ID:Alenett,项目名称:TES-Reloaded-Source,代码行数:35,代码来源:Commands_Packages.cpp

示例8: Cmd_TapControl_Execute

static bool Cmd_TapControl_Execute(COMMAND_ARGS)
{
	//returns false if control is not assigned
	*result = 0;
	UINT ctrl = 0;
	UINT keyCode = 0;

	if (!(ExtractArgs(paramInfo, arg1, opcodeOffsetPtr, thisObj, arg3, scriptObj, eventList, &ctrl)))	return true;

	if (ctrl >= CONTROLSMAPPED)	return true;
	if (!InputControls)			GetControlMap();

	keyCode = InputControls[ctrl];
    if (IsKeycodeValid(keyCode))
	{
		DI_data.TapStates[keyCode] = 0x80;
		*result = 1;
	}
	else
	{
		keyCode = AltInputControls[ctrl] + 256;
		if (IsKeycodeValid(keyCode))
		{
			DI_data.TapStates[keyCode] = 0x80;
			*result = 1;
		}
	}

	return true;
}
开发者ID:679565,项目名称:SkyrimOnline,代码行数:30,代码来源:Commands_Input.cpp

示例9: Cmd_IsControl_Execute

// returns 1 if game-assigned control, 2 is custom mod control, 0 otherwise
static bool Cmd_IsControl_Execute(COMMAND_ARGS)
{
	UInt32 key = 0;
	*result = 0;

	if (!ExtractArgs(PASS_EXTRACT_ARGS, &key))
		return true;

	// check game controls
	if (!InputControls)
		GetControlMap();

	UInt8* controls = InputControls;
	if (key > 255)
	{
		key -= 256;
		controls = AltInputControls;
	}

	for (UInt32 i = 0; i < CONTROLSMAPPED; i++)
	{
		if (controls[i] == key)
		{
			*result = 1;
			return true;
		}
	}

	// check mod custom controls
	if (registeredControls[key].size())
		*result = 2;

	return true;
}
开发者ID:679565,项目名称:SkyrimOnline,代码行数:35,代码来源:Commands_Input.cpp

示例10: Cmd_OnKeyDown_Execute

static bool Cmd_OnKeyDown_Execute(COMMAND_ARGS)
{
	// key is refID, data is a set of key events that have been returned for that script
	static std::map< UINT, std::set<UINT> > KeyListeners;
	UINT keyCode = 0;
	*result = 0;

	if (!ExtractArgs(paramInfo, arg1, opcodeOffsetPtr, thisObj, arg3, scriptObj, eventList, &keyCode))	return true;

	if (scriptObj)
	{
		std::set<UINT>	* keyList = &KeyListeners[scriptObj->refID];

		if (_isKeyPressed(keyCode))
		{
			if (keyList->find(keyCode) == keyList->end())
			{
				keyList->insert(keyCode);
				*result = 1;
			}
		}
		else if (keyList->find(keyCode) != keyList->end())
		{
			keyList->erase(keyCode);
		}
	}

	return true;
}
开发者ID:679565,项目名称:SkyrimOnline,代码行数:29,代码来源:Commands_Input.cpp

示例11: Cmd_OnControlDown_Execute

static bool Cmd_OnControlDown_Execute(COMMAND_ARGS)
{
	// key is refID, data is a set of key events that have been returned for that script
	static std::map< UINT, std::set<UINT> > CtrlListeners;
	UINT ctrl = 0;
	*result = 0;

	if (!ExtractArgs(paramInfo, arg1, opcodeOffsetPtr, thisObj, arg3, scriptObj, eventList, &ctrl))	return true;

	if (scriptObj)
	{
		std::set<UINT> *	ctrlList = &CtrlListeners[scriptObj->refID];

		if (_isControlPressed(ctrl))
		{
			if (ctrlList->find(ctrl) == ctrlList->end())
			{
				ctrlList->insert(ctrl);
				*result = 1;
			}
		}
		else if (ctrlList->find(ctrl) != ctrlList->end())
		{
			ctrlList->erase(ctrl);
		}
	}

	return true;
}
开发者ID:679565,项目名称:SkyrimOnline,代码行数:29,代码来源:Commands_Input.cpp

示例12: Cmd_EnableControl_Execute

static bool Cmd_EnableControl_Execute(COMMAND_ARGS)
{
	*result = 0;
	UInt32	ctrl = 0;

	if(!ExtractArgs(paramInfo, arg1, opcodeOffsetPtr, thisObj, arg3, scriptObj, eventList, &ctrl)) return true;

	if (!InputControls)
		GetControlMap();

	UInt32 dxCode = InputControls[ctrl];
	if (dxCode != NOKEY && IsKeycodeValid(dxCode))
	{
		DI_data.DisallowStates[dxCode] = 0x80;
		disabledControls[ctrl] = 0;
	}

	dxCode = AltInputControls[ctrl] + 256;
	if (dxCode != NOKEY && IsKeycodeValid(dxCode))	
	{
		DI_data.DisallowStates[dxCode] = 0x80;
		disabledControls[ctrl] = 0;
	}

	return true;
}
开发者ID:679565,项目名称:SkyrimOnline,代码行数:26,代码来源:Commands_Input.cpp

示例13: Cmd_Rand_Execute

bool Cmd_Rand_Execute(COMMAND_ARGS)
{
    if(!Cmd_Rand_Initialized) {
        Cmd_Rand_Initialized=true;
        MersenneTwister::init_genrand(GetTickCount());
    }
    *result = 0;

    float rangeMin = 0;
    float rangeMax = 0;
    if(!ExtractArgs(paramInfo, arg1, opcodeOffsetPtr, thisObj, arg3, scriptObj, eventList, &rangeMin, &rangeMax)) return true;

    if(rangeMax < rangeMin)
    {
        float	temp = rangeMin;
        rangeMin = rangeMax;
        rangeMax = temp;
    }

    float	range = rangeMax - rangeMin;

    double	value = MersenneTwister::genrand_real2() * range;
    value += rangeMin;

    *result = value;

    return true;
}
开发者ID:Silentfood,项目名称:oonline,代码行数:28,代码来源:Commands_Math.cpp

示例14: Cmd_IsClassAttribute_Execute

static bool Cmd_IsClassAttribute_Execute(COMMAND_ARGS)
{
    *result = 0;

    UInt32 attribute = 0;
    TESClass* theClass = NULL;

    ExtractArgs(paramInfo, arg1, opcodeOffsetPtr, thisObj, arg3, scriptObj, eventList, &attribute, &theClass);

    if (attribute > kActorVal_Luck) return true;
    if (!theClass) {
        if (!thisObj) return true;
        TESNPC* npc = (TESNPC *)Oblivion_DynamicCast(thisObj->baseForm, 0, RTTI_TESForm, RTTI_TESNPC, 0);
        if (!npc || !npc->npcClass) return true;
        theClass = npc->npcClass;
    }

    for (int ix = 0; ix < 2; ++ix) {
        if (theClass->attributes[ix] == attribute) {
            *result = 1;
            return true;
        }
    }

    return true;
}
开发者ID:nh2,项目名称:obse,代码行数:26,代码来源:Commands_Class.cpp

示例15: Cmd_SetPCMajorSkillUps_Execute

static bool Cmd_SetPCMajorSkillUps_Execute(COMMAND_ARGS)
{
	UInt32 nuValue = 0;
	*result = 0;
	PlayerCharacter* pc = *g_thePlayer;

	if (ExtractArgs(PASS_EXTRACT_ARGS, &nuValue) && pc)
	{
		pc->majorSkillAdvances = nuValue;

		// check if advancements allow player to level up
		SettingInfo* setting = NULL;
		if (GetGameSetting("iLevelUpSkillCount", &setting))
		{
			float advPts = nuValue / setting->i;
			pc->bCanLevelUp = (advPts >= 1.0) ? 1 : 0;

			// HUD LevelUp icon updates automatically
		}

		*result = (pc->bCanLevelUp) ? 1 : 0;
	}

	return true;
}
开发者ID:Alenett,项目名称:OBSE-for-OR,代码行数:25,代码来源:Commands_Player.cpp


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